/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_rep_masvendidos.java
 *
 * Created on 25/03/2011, 01:35:16 PM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

import java.awt.*;
import java.awt.event.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableCellRenderer;

import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;
/**
 *
 * @author Michelle
 */
public class articulos_sie_rep_masvendidos extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_resumen;
    private javax.swing.table.DefaultTableModel jtable_modelo_familia;
    private javax.swing.table.DefaultTableModel jtable_modelo_familiadetsub;
    private javax.swing.table.DefaultTableModel jtable_modelo_detallearticulo;
    private javax.swing.table.DefaultTableModel jtable_modelo_detxtie;
    private javax.swing.table.DefaultTableModel jtable_modelo_familias;
    private javax.swing.table.DefaultTableModel jtable_modelo_familiadetsub2;
    private javax.swing.table.DefaultTableModel jtable_modelo_detallearticulo2;
    private javax.swing.table.DefaultTableModel jtable_modelo_prov;
    private javax.swing.table.DefaultTableModel jtable_modelo_comvsventa;

    final TableRowSorter<javax.swing.table.DefaultTableModel> sorter = new TableRowSorter<javax.swing.table.DefaultTableModel>(jtable_modelo);
    DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;
      //private javax.swing.table.DefaultTableModel jtable_tiendas;
      private  JTable jtable_tiendas=variables_global.gettabla_tiendas();
      private java.util.Date fechahoy=new Date();
      java.util.Date fechaestaeuropa=null;
      private String esquesele="0",textohtml="";
      bd_conexion x = new bd_conexion();
      ResultSet rs = null;
      private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
      private int ordenamiento=2,controlcombo=0,indice=0,visualisa=0,columnavisualisa=1,columnaanterior=0,i1=0,i0=1,i2=0,i3=0,centrar=0,i4=0,vercop=1,i5=0;
    /** Creates new form articulos_sie_rep_masvendidos */
    public articulos_sie_rep_masvendidos() {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_resumenreporte();
        this.iniciar_modelo_familia();
        this.iniciar_modelo_familiadetsubfam();
        this.iniciar_modelo_articulodetalle();
        this.iniciar_modelo_fam_detxtie();
        this.iniciar_modelo_familias();
        this.iniciar_modelo_familiadetsubfam2();
        this.iniciar_modelo_articulodetalle2();
        this.iniciar_modelo_de_tablaprov();
        this.iniciar_modelo_comprasvsventas();
        initComponents();
       // x.estableceConexion();
        this.setLocation(5,5);
        this.loadcombo();

        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);
        this.jdc_fechainicial.setDate(fechaini.getTime());
        this.jdc_fechafinal.setDate(fechahoy);
         //this.buttonGroup1.setSelected(jrbtn_estemes.getModel(), true);
        //this.buttonGroup2.setSelected(jrbtn_importe.getModel(), true);
     if(JOptionPane.showConfirmDialog(null, "Deseas Ver Reporte de Este mes?")==0)
        {
                    this.contruir_reporte(1,this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),"0",esquesele);
                    i0=1;
                    this.contruir_reporte_compraarticulos(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,esquesele,this.jtf_idsubfamilia.getText(),"");
                    this.crea_hoja_comprasvsventas();
        }

        jtb_articmasven.getColumnModel().getColumn(0).setPreferredWidth(10);//Lugar
        jtb_articmasven.getColumnModel().getColumn(1).setPreferredWidth(60);//codigo
        jtb_articmasven.getColumnModel().getColumn(2).setPreferredWidth(160);//descripcion
        jtb_articmasven.getColumnModel().getColumn(3).setPreferredWidth(70);//item
        jtb_articmasven.getColumnModel().getColumn(4).setPreferredWidth(30);//Piezs
        jtb_articmasven.getColumnModel().getColumn(5).setPreferredWidth(60);//Importe
        jtb_articmasven.getColumnModel().getColumn(6).setPreferredWidth(100);//Familia
        jtb_articmasven.getColumnModel().getColumn(7).setPreferredWidth(100);//Subfamilia
        jtb_articmasven.getColumnModel().getColumn(8).setPreferredWidth(90);//tem venta



        jtb_articmasven.getTableHeader().setBackground(Color.yellow);


        jtb_repxfamilias.getColumnModel().getColumn(0).setPreferredWidth(80);//Lugar
        jtb_repxfamilias.getColumnModel().getColumn(1).setPreferredWidth(35);//codigo
        jtb_repxfamilias.getColumnModel().getColumn(2).setPreferredWidth(35);//piezas.
        jtb_repxfamilias.getColumnModel().getColumn(3).setPreferredWidth(35);//Descripcion
        jtb_repxfamilias.getColumnModel().getColumn(4).setPreferredWidth(35);//item
        jtb_repxfamilias.getColumnModel().getColumn(5).setPreferredWidth(20);//Descripcion
        jtb_repxfamilias.getColumnModel().getColumn(6).setPreferredWidth(20);//item
        jtb_repxfamilias.getColumnModel().getColumn(7).setPreferredWidth(20);//Descripcion

        jtb_repxfamiliasdetalle.getColumnModel().getColumn(0).setPreferredWidth(5);//Lugar
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(2).setPreferredWidth(30);//piezas.
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(3).setPreferredWidth(30);//Descripcion
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(4).setPreferredWidth(30);//item

        jtb_repxfamiliasdetarti.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(1).setPreferredWidth(120);//codigo
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(2).setPreferredWidth(60);//piezas.
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(3).setPreferredWidth(25);//Descripcion
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(4).setPreferredWidth(25);//item

        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(0).setPreferredWidth(5);//Lugar
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(2).setPreferredWidth(30);//piezas.
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(3).setPreferredWidth(30);//Descripcion
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(4).setPreferredWidth(30);//item

        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(1).setPreferredWidth(120);//codigo
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(2).setPreferredWidth(60);//piezas.
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(3).setPreferredWidth(25);//Descripcion
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(4).setPreferredWidth(25);//item

        jtb_familias.getColumnModel().getColumn(0).setPreferredWidth(20);//Lugar
        jtb_familias.getColumnModel().getColumn(1).setPreferredWidth(180);//codigo

        jt_repmasvenprovee.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_repmasvenprovee.getColumnModel().getColumn(1).setPreferredWidth(40);//familia
        jt_repmasvenprovee.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_repmasvenprovee.getColumnModel().getColumn(3).setPreferredWidth(60);//id
        jt_repmasvenprovee.getColumnModel().getColumn(4).setPreferredWidth(60);//clave
        jt_repmasvenprovee.getColumnModel().getColumn(5).setPreferredWidth(35);//descrip.
        jt_repmasvenprovee.getColumnModel().getColumn(6).setPreferredWidth(35);//item
        jt_repmasvenprovee.getColumnModel().getColumn(7).setPreferredWidth(35);//precio
        jt_repmasvenprovee.getColumnModel().getColumn(8).setPreferredWidth(180);//f.ult. compra

        jtb_articmasven1.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_articmasven1.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_articmasven1.getColumnModel().getColumn(2).setPreferredWidth(160);//descripcion
        jtb_articmasven1.getColumnModel().getColumn(3).setPreferredWidth(40);//item
        jtb_articmasven1.getColumnModel().getColumn(4).setPreferredWidth(40);//Piezs
        jtb_articmasven1.getColumnModel().getColumn(5).setPreferredWidth(30);//Importe
        jtb_articmasven1.getColumnModel().getColumn(6).setPreferredWidth(60);//Familia
        jtb_articmasven1.getColumnModel().getColumn(7).setPreferredWidth(60);//Subfamilia
        jtb_articmasven1.getColumnModel().getColumn(8).setPreferredWidth(60);//tem venta
        jtb_articmasven1.getColumnModel().getColumn(9).setPreferredWidth(80);//tem venta

        this.buttonGroup1.setSelected(jrbtn_estemes.getModel(), true);
        this.buttonGroup2.setSelected(jrbtn_columnaclave.getModel(), true);
        this.buttonGroup3.setSelected(jrbtn_importe.getModel(), true);
        this.buttonGroup3.setSelected(jrbtn_Costo.getModel(), true);
        
        
        
        this.jlb_resultado.setText("");
      this.jPanel5.setVisible(false);
      centrar=1;
      this.centrar_datos();
      this.contruir_reporte_familias();
    }
public articulos_sie_rep_masvendidos(int opcion,String idtienda,String idclasiff,String vfechaini,String vfechafin,String titulo) {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_resumenreporte();
        this.iniciar_modelo_familia();
        this.iniciar_modelo_familiadetsubfam();
        this.iniciar_modelo_articulodetalle();
        this.iniciar_modelo_fam_detxtie();
        this.iniciar_modelo_familias();
        this.iniciar_modelo_familiadetsubfam2();
        this.iniciar_modelo_articulodetalle2();
        this.iniciar_modelo_de_tablaprov();
        this.iniciar_modelo_comprasvsventas();
        initComponents();
       // x.estableceConexion();
        this.setLocation(5,5);
        this.loadcombo();
      
        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);
        this.jdc_fechainicial.setDate(fechaini.getTime());
        this.jdc_fechafinal.setDate(fechahoy);
        
         //this.buttonGroup1.setSelected(jrbtn_estemes.getModel(), true);
        //this.buttonGroup2.setSelected(jrbtn_importe.getModel(), true);

        //this.contruir_reporte(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),0,esquesele);
        jtb_articmasven.getColumnModel().getColumn(0).setPreferredWidth(10);//Lugar
        jtb_articmasven.getColumnModel().getColumn(1).setPreferredWidth(60);//codigo
        jtb_articmasven.getColumnModel().getColumn(2).setPreferredWidth(160);//descripcion
        jtb_articmasven.getColumnModel().getColumn(3).setPreferredWidth(70);//item
        jtb_articmasven.getColumnModel().getColumn(4).setPreferredWidth(30);//Piezs
        jtb_articmasven.getColumnModel().getColumn(5).setPreferredWidth(60);//Importe
        jtb_articmasven.getColumnModel().getColumn(6).setPreferredWidth(100);//Familia
        jtb_articmasven.getColumnModel().getColumn(7).setPreferredWidth(100);//Subfamilia
        jtb_articmasven.getColumnModel().getColumn(8).setPreferredWidth(90);//tem venta

        jtb_articmasven.getColumnModel().getColumn(9).setPreferredWidth(30);//Linea


        jtb_repxfamilias.getColumnModel().getColumn(0).setPreferredWidth(80);//Lugar
        jtb_repxfamilias.getColumnModel().getColumn(1).setPreferredWidth(35);//codigo
        jtb_repxfamilias.getColumnModel().getColumn(2).setPreferredWidth(35);//piezas.
        jtb_repxfamilias.getColumnModel().getColumn(3).setPreferredWidth(35);//Descripcion
        jtb_repxfamilias.getColumnModel().getColumn(4).setPreferredWidth(35);//item
        jtb_repxfamilias.getColumnModel().getColumn(5).setPreferredWidth(20);//Descripcion
        jtb_repxfamilias.getColumnModel().getColumn(6).setPreferredWidth(20);//item
        jtb_repxfamilias.getColumnModel().getColumn(7).setPreferredWidth(20);//Descripcion


        jtb_repxfamiliasdetalle.getColumnModel().getColumn(0).setPreferredWidth(5);//Lugar
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(2).setPreferredWidth(30);//piezas.
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(3).setPreferredWidth(30);//Descripcion
        jtb_repxfamiliasdetalle.getColumnModel().getColumn(4).setPreferredWidth(30);//item

        jtb_repxfamiliasdetarti.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(1).setPreferredWidth(120);//codigo
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(2).setPreferredWidth(60);//piezas.
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(3).setPreferredWidth(25);//Descripcion
        jtb_repxfamiliasdetarti.getColumnModel().getColumn(4).setPreferredWidth(25);//item


        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(0).setPreferredWidth(5);//Lugar
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(2).setPreferredWidth(30);//piezas.
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(3).setPreferredWidth(30);//Descripcion
        jtb_repxfamiliasdetalle2.getColumnModel().getColumn(4).setPreferredWidth(30);//item

        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(1).setPreferredWidth(120);//codigo
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(2).setPreferredWidth(60);//piezas.
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(3).setPreferredWidth(25);//Descripcion
        jtb_repxfamiliasdetarti2.getColumnModel().getColumn(4).setPreferredWidth(25);//item

         jtb_articmasven1.getColumnModel().getColumn(0).setPreferredWidth(60);//Lugar
        jtb_articmasven1.getColumnModel().getColumn(1).setPreferredWidth(80);//codigo
        jtb_articmasven1.getColumnModel().getColumn(2).setPreferredWidth(160);//descripcion
        jtb_articmasven1.getColumnModel().getColumn(3).setPreferredWidth(40);//item
        jtb_articmasven1.getColumnModel().getColumn(4).setPreferredWidth(40);//Piezs
        jtb_articmasven1.getColumnModel().getColumn(5).setPreferredWidth(30);//Importe
        jtb_articmasven1.getColumnModel().getColumn(6).setPreferredWidth(60);//Familia
        jtb_articmasven1.getColumnModel().getColumn(7).setPreferredWidth(60);//Subfamilia
        jtb_articmasven1.getColumnModel().getColumn(8).setPreferredWidth(60);//tem venta
        jtb_articmasven1.getColumnModel().getColumn(9).setPreferredWidth(80);//tem venta

        jtb_articmasven.getTableHeader().setBackground(Color.yellow);

      
        //jtb_articmasven.setRowSorter(sorter);
        if (opcion==1)
            {
                this.contruir_reporte(2,vfechaini, vfechafin, idclasiff, idtienda);
                this.contruir_reporte_resumen(opcion,"0",vfechaini, vfechafin,idclasiff);
                this.contruir_reporte_compraarticulos(vfechaini, vfechafin,ordenamiento,idtienda,idclasiff,"");
                this.crea_hoja_comprasvsventas();
                this.jtf_idsubfamilia.setText(idclasiff);
                this.jtf_describereporte.setText(titulo);
                this.jtf_opcion.setText(String.valueOf(opcion));
                try
                                {
                                    fechaestaeuropa = formateadoresta.parse(vfechaini);
                                    this.jdc_fechainicial.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                 try
                                {
                                    fechaestaeuropa = formateadoresta.parse(vfechafin);
                                    this.jdc_fechafinal.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
            }
        if (opcion==2)
            {
                this.contruir_reporte(3,vfechaini, vfechafin, idclasiff, idtienda);
                this.contruir_reporte_resumen(opcion,"0",vfechaini, vfechafin,idclasiff);

                this.contruir_reporte_compraarticulos(vfechaini,vfechafin,ordenamiento,idtienda,idclasiff,"");
                this.crea_hoja_comprasvsventas();

                 try
                                {
                                    fechaestaeuropa = formateadoresta.parse(vfechaini);
                                    this.jdc_fechainicial.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                 try
                                {
                                    fechaestaeuropa = formateadoresta.parse(vfechafin);
                                    this.jdc_fechafinal.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                this.jtf_idsubfamilia.setText(idclasiff);
                this.jtf_describereporte.setText(titulo);
                this.jtf_opcion.setText(String.valueOf(opcion));
            }
        this.buttonGroup1.setSelected(jrbtn_estemes.getModel(), true);
        this.buttonGroup2.setSelected(jrbtn_columnaclave.getModel(), true);
        centrar=1;
        this.centrar_datos();
        i0=1;
        this.contruir_reporte_familias();
    }


private void iniciar_modelo_de_tablaprov()
    {

        jtable_modelo_prov=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_prov.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo_prov.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_prov.addColumn("<html><b>Imp.Precio Venta</b></html>");
        jtable_modelo_prov.addColumn("<html><b>Imp. Costo</b></html>");
        jtable_modelo_prov.addColumn("<html><b>Diferencia</b></html>");
        jtable_modelo_prov.addColumn("<html><b>D/C</b></html>");
        jtable_modelo_prov.addColumn("<html><b>% Venta</b></html>");
        jtable_modelo_prov.addColumn("<html><b>% Acum.</b></html>");
        jtable_modelo_prov.addColumn("<html><b>Proveedor");
   }

private void loadcombo(){
        jtable_tiendas=variables_global.gettabla_tiendas();
         int numerotiendas=this.jtable_tiendas.getRowCount();
         this.jcbx_tiendas.addItem("0:Todas Las Tiendas");
          for(int ii=0;ii<numerotiendas;ii++)
                        {
                            this.jcbx_tiendas.addItem(jtable_tiendas.getValueAt(ii, 1).toString()+":"+jtable_tiendas.getValueAt(ii, 0).toString());
                        }

    }

 private void iniciar_modelo_de_tabla()
    {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo.addColumn("<html><b>Clave</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo.addColumn("<html><b>Item</b></html>");
        jtable_modelo.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo.addColumn("<html><b>Importe</b></html>");
        jtable_modelo.addColumn("<html><b>Familia</b></html>");
        jtable_modelo.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo.addColumn("<html><b>Tem. Venta</b></html>");
        jtable_modelo.addColumn("<html><b>Linea</b></html>");
   }
  private void iniciar_modelo_familia()
    {
        jtable_modelo_familia=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_familia.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_familia.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_familia.addColumn("<html><b>Imp.Precio Venta</b></html>");
        jtable_modelo_familia.addColumn("<html><b>Imp. Costo</b></html>");
        jtable_modelo_familia.addColumn("<html><b>Dif.</b></html>");
        jtable_modelo_familia.addColumn("<html><b>D/C</b></html>");
        jtable_modelo_familia.addColumn("<html><b>% Venta</b></html>");
        jtable_modelo_familia.addColumn("<html><b>% Acum.</b></html>");
 
   }

      private void iniciar_modelo_familiadetsubfam()
    {
        jtable_modelo_familiadetsub=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_familiadetsub.addColumn("<html><b>Id</b></html>");
        jtable_modelo_familiadetsub.addColumn("<html><b>Subfamilia</b></html>");
        jtable_modelo_familiadetsub.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_familiadetsub.addColumn("<html><b>Imp.Costo</b></html>");
        jtable_modelo_familiadetsub.addColumn("<html><b>Imp. Precio</b></html>");
   }

            private void iniciar_modelo_familiadetsubfam2()
    {
        jtable_modelo_familiadetsub2=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_familiadetsub2.addColumn("<html><b>Id</b></html>");
        jtable_modelo_familiadetsub2.addColumn("<html><b>Subfamilia</b></html>");
        jtable_modelo_familiadetsub2.addColumn("<html><b>Cant. Piezas</b></html>");
        jtable_modelo_familiadetsub2.addColumn("<html><b>Imp.Costo</b></html>");
        jtable_modelo_familiadetsub2.addColumn("<html><b>Imp. Precio</b></html>");
   }
 private void iniciar_modelo_articulodetalle()
    {
        jtable_modelo_detallearticulo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detallearticulo.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_detallearticulo.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detallearticulo.addColumn("<html><b>Item</b></html>");
        jtable_modelo_detallearticulo.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo_detallearticulo.addColumn("<html><b>Importe</b></html>");
   }
 private void iniciar_modelo_articulodetalle2()
    {
        jtable_modelo_detallearticulo2=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detallearticulo2.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_detallearticulo2.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detallearticulo2.addColumn("<html><b>Item</b></html>");
        jtable_modelo_detallearticulo2.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo_detallearticulo2.addColumn("<html><b>Importe</b></html>");
   }
 private void iniciar_modelo_fam_detxtie()
    {
        int numerotiendas=this.jtable_tiendas.getRowCount(),ii=0,idtienda=0,ndias=0;
        jtable_modelo_detxtie=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detxtie.addColumn("Familia");
        for(int i=0;i<numerotiendas;i++)
           {
                 jtable_modelo_detxtie.addColumn("<html><b>"+this.jtable_tiendas.getValueAt(i,1).toString()+":"+this.jtable_tiendas.getValueAt(i,0).toString()+"</b></html>");
           }
        jtable_modelo_detxtie.addColumn("Total Familia");
    }

 private void iniciar_modelo_resumenreporte()
    {
        int numerotiendas=this.jtable_tiendas.getRowCount(),ii=0,idtienda=0,ndias=0;
        jtable_modelo_resumen=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_resumen.addColumn("Mes/Tienda");
        for(int i=0;i<numerotiendas;i++)
           {
                 jtable_modelo_resumen.addColumn("<html><b>"+this.jtable_tiendas.getValueAt(i,1).toString()+":"+this.jtable_tiendas.getValueAt(i,0).toString()+"</b></html>");
           }
        jtable_modelo_resumen.addColumn("Totales");

          int numerocolumnas=this.jtable_modelo_resumen.getColumnCount();
         Object[] fnewRow = new Object[numerocolumnas];
        fnewRow[0]="<html><h3><b>Piezas: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);

        fnewRow[0]="<html><h3><b>Precio: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);
        fnewRow[0]="<html><h3><b>Costo: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);

        fnewRow[0]="<html><h3><b>Utilidad: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);

        fnewRow[0]="<html><h3><b>%: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);

        fnewRow[0]="<html><h3><b>Costo Actual Inve.: "+"</b></h3></html>";
            for( ii=1;ii<numerocolumnas;ii++)
                {
                    fnewRow[ii]="0";
                }
        jtable_modelo_resumen.addRow(fnewRow);
       

    }

    private void iniciar_modelo_familias()
    {
        jtable_modelo_familias=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_familias.addColumn("<html><b>Id</b></html>");
        jtable_modelo_familias.addColumn("<html><b>familia</b></html>");

   }

 private void iniciar_modelo_comprasvsventas()
    {
        jtable_modelo_comvsventa=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_comvsventa.addColumn("<html><b>Lugar</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Pz Ent.</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Pz Ven.</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>% Rota</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Proveedor</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Tem. Venta</b></html>");
        jtable_modelo_comvsventa.addColumn("<html><b>Linea</b></html>");
   }

 private int findcolumna_idtienda (String titulo)  {
  int columnas = jtable_modelo_resumen.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_resumen.getColumnName(j).replace("<html><b>","").split(":");
                     System.out.println("Busqueda:"+columtitulo[0]+" "+titulo);
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo[0]+" "+columencontrado);
                        }
                }
    return columencontrado;
}

 private void crea_hoja_comprasvsventas()
    {
        String mesactual="",codigo="", selectin="";
        DecimalFormat miformat = new DecimalFormat("#########");
        Object[] fnewRow = new Object[10];
        float pv=0,pc=0,apv=0,apc=0;
        int ii=00,j=0;
       //invoco al metodo que trae el recordset de datos
        for( ii=0;ii<this.jtable_modelo_comvsventa.getRowCount();ii++)
                {
                    mesactual=jtable_modelo_comvsventa.getValueAt(ii, 1).toString();
                    // System.out.println("Agregando:"+mesactual+" "+mes);
                    for( j=0;j<this.jtable_modelo.getRowCount();j++)
                        {
                         codigo=jtable_modelo.getValueAt(j, 1).toString();
                        if (mesactual.equals(codigo))
                            {
                                
                                //jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 2).toString(),ii ,2);//descripcion
                                jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 4).toString(),ii ,4);//descripcion
                                jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 6).toString(),ii ,6);//familia
                                jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 7).toString(),ii ,7);//proveedor
                                jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 8).toString(),ii ,8);//temporada venta
                                jtable_modelo_comvsventa.setValueAt(jtable_modelo.getValueAt(j, 9).toString(),ii ,9);//linea
                                j=this.jtable_modelo.getRowCount();
                            }
                        }
                }
        j=0;
        for( ii=0;ii<this.jtable_modelo_comvsventa.getRowCount();ii++)
                {
                    mesactual=jtable_modelo_comvsventa.getValueAt(ii, 2).toString();
                       
                                if (j>0)
                                    {
                                        selectin+=".";
                                    }
                                selectin+=""+jtable_modelo_comvsventa.getValueAt(ii ,1)+"";
                                j=1;


                }
         String texto="select * from x1sieuno_articulo_catalogov2(12,0,'"+selectin+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25))";
         System.out.println(texto);
             try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                         for( ii=0;ii<this.jtable_modelo_comvsventa.getRowCount();ii++)
                            {
                                mesactual=jtable_modelo_comvsventa.getValueAt(ii, 1).toString();
                                codigo=jtable_modelo_comvsventa.getValueAt(ii, 2).toString();
                                if (mesactual.equals(rs.getString ("cla")))
                                    {
                                        jtable_modelo_comvsventa.setValueAt(this.fechaeuropea(rs.getString("fe")),ii ,0);//linea
                                        jtable_modelo_comvsventa.setValueAt(rs.getString("id")+":"+rs.getString("des"),ii ,2);//descripcion
                                        if ((mesactual.equals(rs.getString ("cla")))&&(codigo.equals(".")))
                                            {
                                            jtable_modelo_comvsventa.setValueAt(rs.getString("nomfa"),ii ,6);//familia
                                            jtable_modelo_comvsventa.setValueAt(rs.getString("nomsub"),ii ,7);//proveedor
                                            jtable_modelo_comvsventa.setValueAt(rs.getString("describetemventa"),ii ,8);//temporada venta
                                            jtable_modelo_comvsventa.setValueAt(rs.getString("descriplinea"),ii ,9);//linea

                                            jtable_modelo_comvsventa.setValueAt(this.fechaeuropea(rs.getString("fe")),ii ,0);//linea
                                            }
                                        ii=this.jtable_modelo_comvsventa.getRowCount();
                                    }
                            }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }

          for( ii=0;ii<this.jtable_modelo_comvsventa.getRowCount();ii++)
                            {
                                pv=Float.valueOf(jtable_modelo_comvsventa.getValueAt(ii, 4).toString());
                                pc=Float.valueOf(jtable_modelo_comvsventa.getValueAt(ii, 3).toString());
                                jtable_modelo_comvsventa.setValueAt(miformat.format((pv/pc)*100)+"%",ii ,5);//descripcion
                                apv+=pv;
                                apc+=pc;
                            }
                              fnewRow[0]="";
                              fnewRow[1]="";
                              fnewRow[2]="Totales";
                              fnewRow[3]=miformat.format(apc);
                              fnewRow[4]=miformat.format(apv);
                              fnewRow[5]=miformat.format((apv/apc)*100)+"%";
                              fnewRow[6]=".";
                              fnewRow[7]=".";
                              fnewRow[8]=".";
                              fnewRow[9]=".";
                              jtable_modelo_comvsventa.addRow(fnewRow);
   }

public void centrar_datos()
    {
        alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);
        int ii=0,numerotiendas=0;
        if(centrar==1)
            {
                            jtb_articmasven.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
                            jtb_articmasven.getColumnModel().getColumn(5).setCellRenderer(alinearderecha);

                            numerotiendas=this.jtable_modelo_familia.getColumnCount();
                            for(ii=1;ii<numerotiendas;ii++)
                                {
                                    jtb_repxfamilias.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }

                            jtb_repxfamiliasdetalle.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetalle.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetalle.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);

                            jtb_repxfamiliasdetarti.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetarti.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);

                            numerotiendas=this.jtable_modelo_detxtie.getColumnCount();
                            for(ii=1;ii<numerotiendas;ii++)
                                {
                                    jtb_repxfamiliasxtienda.getColumnModel().getColumn(ii).setCellRenderer(alinearderecha);
                                }
                            jtb_repxfamiliasdetalle2.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetalle2.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetalle2.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);

                            jtb_repxfamiliasdetarti2.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
                            jtb_repxfamiliasdetarti2.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);

                            jt_repmasvenprovee.getColumnModel().getColumn(1).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(3).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(4).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(5).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(6).setCellRenderer(alinearderecha);
                            jt_repmasvenprovee.getColumnModel().getColumn(7).setCellRenderer(alinearderecha);
            }
    }

private void contruir_reporte(int opcion,String fechai,String fecha,String filtro,String idesq)
    {
        //fecha es la final del reporte
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
       
        //this.jtf_describereporte.setText("");
        //this.jtf_opcion.setText("0");
        //this.jtf_idsubfamilia.setText("");

        while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);

        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0,rankin=0;
        //indicamos 7 columnas
        Object valtie = null,fnewRow[] = new Object[10];

        String serie1="",tienda="",texto="",titulografico="",titulograficoh="",ti="";

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0;

        texto="select * from x1sieuno_articulo_masvendidosv3("+opcion+","+filtro+",'"+idesq+"','"+fechai+"','"+fecha+"') as (id integer, can real,importe double precision,clavepro character varying(16),desclave character varying(80),itemclave character varying(80),nomfamclave character varying(40),nomsubfam character varying(50),nomtemventa character varying(25),descriplinea character varying(25));";
        System.out.println(texto);
            try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            rankin++;
                            totalpiezas+=rs.getFloat(2);
                            importe+=rs.getFloat(3);
                              fnewRow[0]=""+rankin+"";
                              fnewRow[1]=""+rs.getString("clavepro")+"";
                              fnewRow[2]=rs.getString("id")+":"+rs.getString("desclave")+"";
                              fnewRow[3]=""+rs.getString("itemclave")+"";
                              fnewRow[4]=""+miformat.format(rs.getFloat("can"))+"";
                              fnewRow[5]=""+miformat.format(rs.getFloat("importe"))+"";
                              fnewRow[6]=""+rs.getString("nomfamclave")+"";
                              fnewRow[7]=""+rs.getString("nomsubfam")+"";
                              fnewRow[8]=""+rs.getString("nomtemventa")+"";
                              fnewRow[9]=""+rs.getString("descriplinea")+"";
                              jtable_modelo.addRow(fnewRow);
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

           jtable_modelo.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","","","","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","","","","","",""});
this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
this.carga_datos_fotospaginacion(0);
 }
private void contruir_reporte_resumen(int opcion,String idtie,String fechai,String fecha,String idclasif)
    {
        //fecha es la final del reporte

        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int numerotiendas=this.jtable_modelo_resumen.getColumnCount()-2;
        String mespartido[]=null,text="";
        float importecosto=0;
        int columnatitulo=0;
        text="select * from x1ventasxdiferentesclasificaciones("+opcion+",'"+idtie+"','"+fechai+"','"+fecha+"',"+idclasif+") as (id integer, can real,importe double precision,importecosto double precision,utilidad double precision,nom text);";
        System.out.println(text);
               try{
                 rs=x.sieuno_executediversosv2(text,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            mespartido=rs.getString("nom").split(":");
                            columnatitulo=this.findcolumna_idtienda(mespartido[0]);
                            jtable_modelo_resumen.setValueAt(miformat.format(rs.getFloat("can")),0 ,columnatitulo);
                            jtable_modelo_resumen.setValueAt(miformat.format(rs.getFloat("importe")),1 ,columnatitulo);
                            jtable_modelo_resumen.setValueAt(miformat.format(rs.getFloat("importecosto")),2 ,columnatitulo);
                            jtable_modelo_resumen.setValueAt(miformat.format(rs.getFloat("utilidad")),3 ,columnatitulo);
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
                 text="select * from x1sieuno_articulo_costos_varios("+opcion+",0,'"+idclasif+"','') as (idsubfam integer,importe double precision,nombre text);";
                try{
                    rs=x.sieuno_executediversosv2(text,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            mespartido=rs.getString("nombre").split(":");
                            columnatitulo=this.findcolumna_idtienda(mespartido[0]);
                            importecosto+=rs.getFloat("importe");
                            jtable_modelo_resumen.setValueAt(miformat.format(rs.getFloat("importe")),5,columnatitulo);
                        }
                        jtable_modelo_resumen.setValueAt("<html><h3><b>"+miformat.format(importecosto)+"</b></h3></html>",5,numerotiendas+1);
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

                     this.contruir_totales_resumen();

 }

private void contruir_reporte_familia(Date fechai,Date fecha,int ordena,String idesq)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         
        while(jtable_modelo_familia.getRowCount()>0)jtable_modelo_familia.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        DecimalFormat miformat2 = new DecimalFormat("############.##");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai),pFecha = formato.format(fecha),serie1="",tienda="",titulografico="",titulograficoh="",ti="",texto="";//fecha final de reporte

        double importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0;

        texto="select * from x1venta_articulo_xfamilia(1,'"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"','','','') as (id integer, can real,importe double precision,importecosto double precision,utilidad double precision,nom character varying(50));";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            totalpiezas+=rs.getFloat(2);
                            importe+=rs.getFloat(3);
                            totcosto+=rs.getFloat(4);
                            totutili+=rs.getFloat(5);
                            jtable_modelo_familia.addRow(new Object[]{rs.getString (1)+":"+rs.getString(6),miformat.format(rs.getFloat(2)),miformat2.format(rs.getDouble(3)),miformat.format(rs.getDouble(4)),miformat.format(rs.getDouble(5)),miformat.format((rs.getDouble(5)/rs.getDouble(4))*100),0,0});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo_familia.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat2.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat2.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat2.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat2.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});

            titulografico="Grafica Ventas X Familia : "+this.fechaeuropea(fechai)+" A " + this.fechaeuropea(fecha)+" Total="+miformat.format(importe)+"";

            variables_global.settitulografica_armasvf(titulografico);

            int numerofilas=this.jtable_modelo_familia.getRowCount()-1;

             for(int i = 0 ;i < numerofilas; i++)
                {
                 valtie=this.jtable_modelo_familia.getValueAt(i,2);
                 serie1=this.jtable_modelo_familia.getValueAt(i,0).toString();

                 importe2=Float.valueOf(valtie.toString().replace(",","").replace(".",""));
                 totporcen=(Float.valueOf(valtie.toString().replace(",","").replace(".",""))/importe)*100;
                 totporcenacum+=totporcen;
                 jtable_modelo_familia.setValueAt(miformat.format(totporcen)+"%",i,6);
                 jtable_modelo_familia.setValueAt(miformat.format(totporcenacum)+"%",i,7);

                  dataset.addValue(importe2,this.jtable_modelo_familia.getValueAt(i,0).toString()+"="+serie1,"Familias");

                 }

                variables_global.setdatasetarmasvf(dataset);
            this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
 }

private void contruir_reporte_familias()
    {
        String texto="";

        texto="select * from x1sieuno_articulo_familias_articulo() as (id integer, descrip character varying(40),nom text);";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            jtable_modelo_familias.addRow(new Object[]{rs.getString("id"),rs.getString("descrip")});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

 }


private void contruir_reporte_familia_detalle(String fechai,String fechaf,int ordena,String idesq,String idfam)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda

        while(jtable_modelo_familiadetsub.getRowCount()>0)jtable_modelo_familiadetsub.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0,rankin=0;
        //indicamos 7 columnas
        Object valtie = null;

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        String texto="";

        texto="select * from x1venta_articulo_xfamilia(2,'"+idesq+"',"+ordena+",'"+fechai+"','"+fechaf+"','"+idfam+"','','') as (id integer, idsubfam integer,can real,importe double precision,importecosto double precision,utilidad double precision,nom text);";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            jtable_modelo_familiadetsub.addRow(new Object[]{rs.getString("id"),rs.getString("idsubfam")+":"+rs.getString("nom"),miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe"))});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

 }
private void contruir_reporte_familia_detalle2(String fechai,String fechaf,int ordena,String idesq,String idfam)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda

        while(jtable_modelo_familiadetsub2.getRowCount()>0)jtable_modelo_familiadetsub2.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0,rankin=0;
        //indicamos 7 columnas
        Object valtie = null;

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        String texto="";

        texto="select * from x1venta_articulo_xfamilia(2,'"+idesq+"',"+ordena+",'"+fechai+"','"+fechaf+"','"+idfam+"','','') as (id integer, idsubfam integer,can real,importe double precision,importecosto double precision,utilidad double precision,nom text);";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            jtable_modelo_familiadetsub2.addRow(new Object[]{rs.getString("id"),rs.getString("idsubfam")+":"+rs.getString("nom"),miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe"))});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

 }

private void contruir_reporte_familia_detallearti(String fechai,String fechaf,int ordena,String idesq,String idfam,String idsubfam)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda

        while(jtable_modelo_detallearticulo.getRowCount()>0)jtable_modelo_detallearticulo.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0,rankin=0;
        //indicamos 7 columnas
        Object valtie = null;

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        String texto="";

        texto="select * from x1venta_articulo_xfamilia(3,'"+idesq+"',"+ordena+",'"+fechai+"','"+fechaf+"','"+idfam+"','"+idsubfam+"','') as (id integer,can real,importe double precision,importecosto double precision,utilidad double precision,clavepro character varying(16),desclave character varying(80),itemclave character varying(80));";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            jtable_modelo_detallearticulo.addRow(new Object[]{rs.getString("clavepro"),rs.getString("id")+":"+rs.getString("desclave"),rs.getString("itemclave"),miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe"))});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

 }
private void contruir_reporte_familia_detallearti2(String fechai,String fechaf,int ordena,String idesq,String idfam,String idsubfam)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda

        while(jtable_modelo_detallearticulo2.getRowCount()>0)jtable_modelo_detallearticulo2.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0,rankin=0;
        //indicamos 7 columnas
        Object valtie = null;

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
        String texto="";

        texto="select * from x1venta_articulo_xfamilia(3,'"+idesq+"',"+ordena+",'"+fechai+"','"+fechaf+"','"+idfam+"','"+idsubfam+"','') as (id integer,can real,importe double precision,importecosto double precision,utilidad double precision,clavepro character varying(16),desclave character varying(80),itemclave character varying(80));";

        System.out.println(texto);
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                 while (rs.next())
                        {
                            jtable_modelo_detallearticulo2.addRow(new Object[]{rs.getString("clavepro"),rs.getString("id")+":"+rs.getString("desclave"),rs.getString("itemclave"),miformat.format(rs.getFloat("can")),miformat.format(rs.getFloat("importecosto")),miformat.format(rs.getFloat("importe"))});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

 }


private void carga_datos_familiaresumen(String fechai,String fechaf,int ordena,String idesq)
    {
       String fechaeuro="";
       int columnatitulo=0;
       String mespartido[]=null;

       while(jtable_modelo_detxtie.getRowCount()>0)jtable_modelo_detxtie.removeRow(0);

       int ncol=this.jtable_modelo_detxtie.getColumnCount();
       Object[] fnewRow = new Object[ncol];
        String texto="select * from x1venta_articulo_xfamilia(4,'0',"+ordena+",'"+fechai+"','"+fechaf+"','','','') as (id integer, can real,importe double precision,importecosto double precision,utilidad double precision,nom text);";
 System.out.println(texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                 System.out.println(rs.getString("id"));
                    if (rs.getString("id") != null)
                        {

                                mespartido=rs.getString("nom").split(":");
                                columnatitulo=this.findcolumna_idtienda(mespartido[2]);
                                switch (vercop)
                                    {
                                        case 1:
                                            this.crea_hoja_familiaresumen(rs.getString("id"), mespartido[1].toUpperCase(),rs.getString("importecosto"),columnatitulo);
                                        break;
                                        case 2:
                                            this.crea_hoja_familiaresumen(rs.getString("id"), mespartido[1].toUpperCase(),rs.getString("importe"),columnatitulo);
                                        break;
                            }
                      }
                }
            }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
     fnewRow[0]="Totales:";
     jtable_modelo_detxtie.addRow(fnewRow);
     this.setTitle("S.I. REPORTE Ventas X Familia del "+fechai+" al "+fechaf);
     this.contruir_totalesfamdetalle();
     }

private void contruir_reporte_compraarticulos(String fechai,String fecha,int ordena,String idesq,String busca6,String busca7)
    {
        //fecha es la final del reporte
        Object[] fnewRow = new Object[10];
        while(jtable_modelo_comvsventa.getRowCount()>0)jtable_modelo_comvsventa.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("############");
        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        
        String texto="select * from x1distribucion_terminados_distribucion_xcliente(4,'"+idesq+"',"+ordena+",'"+fechai+"','"+fecha+"','"+busca6+"','') as (id character varying(16), can numeric,importe numeric,importecosto numeric,utilidad numeric);";

        System.out.println(texto);

        int rankin=0;
                try
                    {
                    rs=x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {
                              rankin++;
                              fnewRow[0]=""+rankin+"";
                              fnewRow[1]=rs.getString("id");
                              fnewRow[2]=".";
                              fnewRow[3]=""+miformat.format(rs.getFloat("can"))+"";
                              fnewRow[4]="0";
                              fnewRow[5]=".";
                              fnewRow[6]=".";
                              fnewRow[7]=".";
                              fnewRow[8]=".";
                              fnewRow[9]=".";
                              jtable_modelo_comvsventa.addRow(fnewRow);
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }
             this.jlbl_cantidadregistros2.setText(String.valueOf(this.jtable_modelo_comvsventa.getRowCount()));
            //jtable_modelo_comvsventa.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});
 }

private void crea_hoja_familiaresumen(String idfamilia,String familiadescribe,String cantidad,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_detxtie.getRowCount();
        String idstat[]=null;
        int numerocolumnas=this.jtable_modelo_detxtie.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(cantidad);
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo_detxtie.getValueAt(ii, 0).toString().split(":");
                    System.out.println("Agregando:"+cantifam+" "+familiadescribe);
                    if (idstat[0].equals(idfamilia))
                        {
                            encontrado=1;
                            jtable_modelo_detxtie.setValueAt(miformat.format(cantifam),ii ,columna);
                        }
                }
       if(encontrado==0)
            {
            fnewRow[0]=idfamilia+":"+familiadescribe;
            for( ii=1;ii<numerocolumnas;ii++)
                {
                               System.out.println(idfamilia+":"+familiadescribe);
                               if(ii==columna)
                                    {
                                        fnewRow[ii]=miformat.format(cantifam);
                                    }
                               else
                                    {
                                        fnewRow[ii]="0";
                                    }
                }
             jtable_modelo_detxtie.addRow(fnewRow);
           }
    }

private void contruir_totalesfamdetalle()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totalve2=0;
         Object[] fnewRow = new Object[jtable_modelo_detxtie.getColumnCount()];
         int totalfilasreporte=this.jtable_modelo_detxtie.getRowCount()-1,i=0,ii=0,numerotiendas=this.jtable_tiendas.getRowCount();
           for(i=0;i<totalfilasreporte;i++)
                  {
                        for( ii=0;ii<numerotiendas;ii++)
                            {
                                totalve+=Float.valueOf(jtable_modelo_detxtie.getValueAt(i, ii+1).toString().replace(",","").replace(".",""));
                            }
                        //jtable_modelo_detxtie.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                        jtable_modelo_detxtie.setValueAt(""+myFormatter.format(totalve)+"",i,ii+1);
                        totalve=0;
                  }
            totalve=0;
           for( ii=0;ii<numerotiendas+1;ii++)
            {
             totalve=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        totalve+=Float.valueOf(jtable_modelo_detxtie.getValueAt(i, ii+1).toString().replace(",","").replace(".",""));
                    }
                    jtable_modelo_detxtie.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                    //jtable_modelo_detxtie.setValueAt(""+myFormatter.format(totalve)+"",i,ii+1);
            }
     }

private void contruir_totales_resumen()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totalpiezas=0;
         int totalfilasreporte=this.jtable_modelo_resumen.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_resumen.getColumnCount()-2;
         //genero los totales por tienda

           for(i=0;i<totalfilasreporte;i++)
                  {
                        totalve=0;
                        for( ii=0;ii<numerotiendas;ii++)
                        {
                            totalve+=Float.valueOf(jtable_modelo_resumen.getValueAt(i, ii+1).toString().replace(",","").replace(".",""));
                        }
                        jtable_modelo_resumen.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                  }
          totalpiezas=Float.valueOf(jtable_modelo_resumen.getValueAt(0, numerotiendas+1).toString().replace(",","").replace(".","").replace("<html><h3><b>", "").replace("</b></h3></html>", ""));
           System.out.println(totalpiezas);
          for( ii=0;ii<numerotiendas;ii++)
                 {
                  totalve=Float.valueOf(jtable_modelo_resumen.getValueAt(0, ii+1).toString().replace(",","").replace(".",""));
                  System.out.println(totalve);
                  jtable_modelo_resumen.setValueAt("<html><h3><b>"+myFormatter.format((totalve/totalpiezas)*100)+"%</b></h3></html>",4,ii+1);
                 }




     }

private void contruir_reporte_prov(Date fechai,Date fecha,int ordena,String idesq)
    {
        //fecha es la final del reporte
         DefaultCategoryDataset dataset = new DefaultCategoryDataset();//detalle por tienda
         String titulografico="",titulograficoh="",ti="";

        while(jtable_modelo_prov.getRowCount()>0)jtable_modelo_prov.removeRow(0);
        DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        int ii=0,idtienda=0,ndias=0,reg=0,noaten=0;
        //indicamos 7 columnas
        Object valtie = null;
        String serie1="",tienda="";

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(fechai);//fecha final de reporte
        String pFecha = formato.format(fecha);//fecha final de reporte

        float importe=0,totalpiezas=0,totcosto=0,totutili=0,totporcen=0,totporcenacum=0,importe2=0,importe3=0;
        int rankin=0;
               try{
                 //rs = x.sieuno_ventas_cortedia(tienda,pFecha,i);
                 rs=x.sieuno_executediversosv2("select * from x1ventasxproveedorv2('"+idesq+"',"+ordena+",'"+pFechai+"','"+pFecha+"') as (id integer, can real,importe double precision,importecosto double precision,utilidad double precision,nom character varying(50));",variables_global.getconexiongral());
                 while (rs.next())
                        {
                            rankin++;
                            totalpiezas+=rs.getFloat(2);
                            importe+=rs.getFloat(3);
                            totcosto+=rs.getFloat(4);
                            totutili+=rs.getFloat(5);
                            jtable_modelo_prov.addRow(new Object[]{rankin,miformat.format(rs.getFloat(2)),miformat.format(rs.getFloat(3)),miformat.format(rs.getFloat(4)),miformat.format(rs.getFloat(5)),miformat.format((rs.getFloat(5)/rs.getFloat(4))*100),0,0,rs.getString (1)+":"+rs.getString (6)});
                        }
                    }
                     catch(Exception e)
                     {
                             System.out.println(e.getMessage());
                     }

            jtable_modelo_prov.addRow(new Object[]{"<html><h3><b>Totales: "+"</b></h3></html>","<html><h3><b>"+miformat.format(totalpiezas)+"</b></h3></html>","<html><h3><b>"+miformat.format(importe)+"</b></h3></html>","<html><h3><b>"+miformat.format(totcosto)+"</b></h3></html>","<html><h3><b>"+miformat.format(totutili)+"</b></h3></html>","<html><h3><b>"+miformat.format((totutili/totcosto)*100)+"</b></h3></html>",0,0,""});

            titulografico="Grafica Ventas X Proveedor : "+this.fechaeuropea(fechai)+" A " + this.fechaeuropea(fecha)+" Total="+miformat.format(importe)+"";

            variables_global.settitulografica_artmasvxp(titulografico);

            int numerofilas=this.jtable_modelo_prov.getRowCount()-1;
             rankin=0;
             for(int i = 0 ;i < numerofilas; i++)
                {
                 valtie=this.jtable_modelo_prov.getValueAt(i,2);
                 serie1=this.jtable_modelo_prov.getValueAt(i,8).toString();

                 importe2=Float.valueOf(valtie.toString().replace(",","").replace(".",""));
                 totporcen=(Float.valueOf(valtie.toString().replace(",","").replace(".",""))/importe)*100;
                 totporcenacum+=totporcen;
                 jtable_modelo_prov.setValueAt(miformat.format(totporcen)+"%",i,6);
                 jtable_modelo_prov.setValueAt(miformat.format(totporcenacum)+"%",i,7);
                 if (serie1.length()>12)
                        {
                            serie1=serie1.substring(0, 12);
                        }

                 if(totporcenacum < 91)
                        {
                            dataset.addValue(importe2,this.jtable_modelo_prov.getValueAt(i,0).toString()+"="+serie1,"Sub Familias");
                             rankin++;
                        }
                 else
                        {
                            importe3+=importe2;
                        }
                 }
                 dataset.addValue(importe3, rankin+" sub Familias 10% Restantes","Sub Familias");

                 variables_global.setdatasetarmasvp(dataset);
                 this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
 }
private void dioclick_prov(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");

        SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");

        String pFechai = formato.format(this.jdc_fechainicial.getDate());//fecha final de reporte
        String pFecha = formato.format(this.jdc_fechafinal.getDate());//fecha final de reporte

        String arreglo_idtienda[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");

        int fila = jt_repmasvenprovee.getSelectedRow();
        String arregle_idsubfam[] = jt_repmasvenprovee.getValueAt(fila, 8).toString().split(":");

        articulos_sie_rep_masvendidos fasrm=new articulos_sie_rep_masvendidos(1, arreglo_idtienda[0],arregle_idsubfam[0],pFechai,pFecha,"Subfamilia:"+arregle_idsubfam[1]);
        fasrm.pack();
        fasrm.setVisible(true);

        //setVisible(false);
    }

private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }


private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";

       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;

    }
    private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;

    }

private void contruir_grafica_distribuciontotal()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtable_modelo_resumen.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_resumen.getColumnCount()-2;
         float totalve=0;
         for( ii=0;ii<numerotiendas;ii++)
            {
                System.out.println(totalfilasreporte);
                totalve=Float.valueOf(jtable_modelo_resumen.getValueAt(1, ii+1).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));

                titulografico=jtable_modelo_resumen.getColumnName(ii+1).replace("<html><b>","").replace("</b></html>","");
                if(totalve>0)
                    {
                        datasetbarra.addValue(totalve,titulografico,"Tiendas");
                    }

         }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas Importe de Ventas",datasetbarra,"Resumen de Ventas X tienda del :"+this.fechaeuropea(this.jdc_fechainicial.getDate())+" al "+this.fechaeuropea(this.jdc_fechafinal.getDate()),"Geneal");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }
private void contruir_grafica_costo()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtable_modelo_resumen.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_resumen.getColumnCount()-2;
         float totalve=0;
         for( ii=0;ii<numerotiendas;ii++)
            {
                System.out.println(totalfilasreporte);
                totalve=Float.valueOf(jtable_modelo_resumen.getValueAt(5, ii+1).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));

                titulografico=jtable_modelo_resumen.getColumnName(ii+1).replace("<html><b>","").replace("</b></html>","");
                if(totalve>0)
                    {
                        datasetbarra.addValue(totalve,titulografico,"Tiendas");
                    }

         }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas costos Proveedor",datasetbarra,"Resumen de inventarios Proveedor :"+this.jtf_idsubfamilia.getText(),"Tiendas");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jt_ventasmensuales = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jLabel11 = new javax.swing.JLabel();
        jtf_opcion = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jtf_idsubfamilia = new javax.swing.JTextField();
        jtf_describereporte = new javax.swing.JTextField();
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jPanel11 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jrbtn_columnaclave = new javax.swing.JRadioButton();
        jRadioButton1 = new javax.swing.JRadioButton();
        jrbtn_item = new javax.swing.JRadioButton();
        jrbtn_linea = new javax.swing.JRadioButton();
        jrbtn_temporada = new javax.swing.JRadioButton();
        jrbtn_columnaclave1 = new javax.swing.JRadioButton();
        jLabel13 = new javax.swing.JLabel();
        jtf_buscarenjtable = new javax.swing.JTextField();
        jlb_resultado = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_articmasven = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jlbl_cantidadregistros = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jScrollPane13 = new javax.swing.JScrollPane();
            jtb_familias = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                ;
                jPanel13 = new javax.swing.JPanel();
                jScrollPane11 = new javax.swing.JScrollPane();
                jep_articuloimagenestadistica3 = new javax.swing.JEditorPane();
                jbtn_imagenfull = new javax.swing.JButton();
                jPanel12 = new javax.swing.JPanel();
                jPanel14 = new javax.swing.JPanel();
                jScrollPane12 = new javax.swing.JScrollPane();
                jepn_fotos = new javax.swing.JEditorPane();
                jtf_fotosartxpag = new javax.swing.JTextField();
                jlbl_paginas = new javax.swing.JLabel();
                jbtn_anterior = new javax.swing.JButton();
                jtf_paginaactual = new javax.swing.JTextField();
                jbtn_siguiente = new javax.swing.JButton();
                jPanel3 = new javax.swing.JPanel();
                jPanel2 = new javax.swing.JPanel();
                jScrollPane2 = new javax.swing.JScrollPane();
                jtb_repxfamilias = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }}

                    ;
                    jrbtn_generagrafica = new javax.swing.JRadioButton();
                    jPanel6 = new javax.swing.JPanel();
                    jScrollPane3 = new javax.swing.JScrollPane();
                    jtb_repxfamiliasdetalle = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        ;
                        jPanel7 = new javax.swing.JPanel();
                        jScrollPane4 = new javax.swing.JScrollPane();
                        jtb_repxfamiliasdetarti = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}

                            ;
                            jScrollPane6 = new javax.swing.JScrollPane();
                            jep_articuloimagenestadistica = new javax.swing.JEditorPane();
                            jtf_idsubfam = new javax.swing.JTextField();
                            jCheckBox4 = new javax.swing.JCheckBox();
                            jtf_idsubfamdescribe = new javax.swing.JTextField();
                            jPanel8 = new javax.swing.JPanel();
                            jScrollPane7 = new javax.swing.JScrollPane();
                            jtb_repxfamiliasxtienda = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                ;
                                jPanel9 = new javax.swing.JPanel();
                                jScrollPane8 = new javax.swing.JScrollPane();
                                jtb_repxfamiliasdetalle2 = new javax.swing.JTable(){
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }}
                                    ;
                                    ;
                                    jtf_tiendaactivada = new javax.swing.JTextField();
                                    jLabel5 = new javax.swing.JLabel();
                                    jPanel10 = new javax.swing.JPanel();
                                    jScrollPane9 = new javax.swing.JScrollPane();
                                    jtb_repxfamiliasdetarti2 = new javax.swing.JTable(){
                                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                                            return false;
                                        }}

                                        ;
                                        jScrollPane10 = new javax.swing.JScrollPane();
                                        jep_articuloimagenestadistica2 = new javax.swing.JEditorPane();
                                        jtf_idsubfam1 = new javax.swing.JTextField();
                                        jtf_idsubfamdescribe1 = new javax.swing.JTextField();
                                        jCheckBox5 = new javax.swing.JCheckBox();
                                        jPanel15 = new javax.swing.JPanel();
                                        jScrollPane14 = new javax.swing.JScrollPane();
                                        jt_repmasvenprovee = new javax.swing.JTable(){
                                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                                return false;
                                            }}
                                            ;
                                            jLabel7 = new javax.swing.JLabel();
                                            jlbl_cantidadregistros1 = new javax.swing.JLabel();
                                            jLabel9 = new javax.swing.JLabel();
                                            jPanel16 = new javax.swing.JPanel();
                                            jPanel17 = new javax.swing.JPanel();
                                            jPanel18 = new javax.swing.JPanel();
                                            jLabel15 = new javax.swing.JLabel();
                                            jrbtn_columnaclave2 = new javax.swing.JRadioButton();
                                            jRadioButton2 = new javax.swing.JRadioButton();
                                            jrbtn_item1 = new javax.swing.JRadioButton();
                                            jrbtn_linea1 = new javax.swing.JRadioButton();
                                            jrbtn_temporada1 = new javax.swing.JRadioButton();
                                            jrbtn_columnaclave3 = new javax.swing.JRadioButton();
                                            jLabel16 = new javax.swing.JLabel();
                                            jtf_buscarenjtable1 = new javax.swing.JTextField();
                                            jlb_resultado1 = new javax.swing.JLabel();
                                            jScrollPane15 = new javax.swing.JScrollPane();
                                            jtb_articmasven1 = new javax.swing.JTable()
                                            {
                                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                                    return false;
                                                }}
                                                ;
                                                jlbl_cantidadregistros2 = new javax.swing.JLabel();
                                                jLabel17 = new javax.swing.JLabel();
                                                jPanel4 = new javax.swing.JPanel();
                                                jLabel8 = new javax.swing.JLabel();
                                                jrbtn_piezas = new javax.swing.JRadioButton();
                                                jrbtn_importe = new javax.swing.JRadioButton();
                                                jrbtn_masrentable = new javax.swing.JRadioButton();
                                                jLabel1 = new javax.swing.JLabel();
                                                jdc_fechainicial = new com.toedter.calendar.JDateChooser();
                                                jLabel2 = new javax.swing.JLabel();
                                                jdc_fechafinal = new com.toedter.calendar.JDateChooser();
                                                jLabel3 = new javax.swing.JLabel();
                                                jrbtn_estemes = new javax.swing.JRadioButton();
                                                jrbtn_mespasada = new javax.swing.JRadioButton();
                                                jrbtn_mesactuaante = new javax.swing.JRadioButton();
                                                jrbtn_incluirtodo = new javax.swing.JRadioButton();
                                                jbtn_generareporte = new javax.swing.JButton();
                                                jLabel4 = new javax.swing.JLabel();
                                                jcbx_tiendas = new javax.swing.JComboBox();
                                                jrbtn_Costo = new javax.swing.JRadioButton();
                                                jrbtn_precio = new javax.swing.JRadioButton();
                                                jLabel14 = new javax.swing.JLabel();
                                                jbtn_generareporte1 = new javax.swing.JButton();
                                                jMenuBar1 = new javax.swing.JMenuBar();
                                                jMenu1 = new javax.swing.JMenu();
                                                jmni_salir = new javax.swing.JMenuItem();
                                                jMenu2 = new javax.swing.JMenu();
                                                jmni_iratiendas = new javax.swing.JMenuItem();
                                                jmni_fechainicial = new javax.swing.JMenuItem();
                                                jmni_iraopcionesfecha = new javax.swing.JMenuItem();
                                                jmni_escape = new javax.swing.JMenuItem();
                                                jmni_irabusquedaenreporte = new javax.swing.JMenuItem();
                                                jMenu3 = new javax.swing.JMenu();
                                                jmni_ayuda = new javax.swing.JMenuItem();
                                                jmni_creacomentario = new javax.swing.JMenuItem();

                                                setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
                                                org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_rep_masvendidos.class);
                                                setTitle(resourceMap.getString("Form.title")); // NOI18N
                                                setName("Form"); // NOI18N

                                                jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                                jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                                    public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                                        jTabbedPane1StateChanged(evt);
                                                    }
                                                });

                                                jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
                                                jPanel1.setName("jPanel1"); // NOI18N

                                                jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
                                                jPanel5.setName("jPanel5"); // NOI18N

                                                jScrollPane5.setName("jScrollPane5"); // NOI18N

                                                jt_ventasmensuales.setModel(this.jtable_modelo_resumen);
                                                jt_ventasmensuales.setName("jt_ventasmensuales"); // NOI18N
                                                jt_ventasmensuales.setRowHeight(22);
                                                jScrollPane5.setViewportView(jt_ventasmensuales);

                                                jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
                                                jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                                                jLabel11.setName("jLabel11"); // NOI18N

                                                jtf_opcion.setEditable(false);
                                                jtf_opcion.setFont(resourceMap.getFont("jtf_opcion.font")); // NOI18N
                                                jtf_opcion.setName("jtf_opcion"); // NOI18N

                                                jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
                                                jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
                                                jLabel10.setName("jLabel10"); // NOI18N

                                                jtf_idsubfamilia.setEditable(false);
                                                jtf_idsubfamilia.setFont(resourceMap.getFont("jtf_idsubfamilia.font")); // NOI18N
                                                jtf_idsubfamilia.setText(resourceMap.getString("jtf_idsubfamilia.text")); // NOI18N
                                                jtf_idsubfamilia.setName("jtf_idsubfamilia"); // NOI18N

                                                jtf_describereporte.setEditable(false);
                                                jtf_describereporte.setFont(resourceMap.getFont("jtf_describereporte.font")); // NOI18N
                                                jtf_describereporte.setText(resourceMap.getString("jtf_describereporte.text")); // NOI18N
                                                jtf_describereporte.setName("jtf_describereporte"); // NOI18N

                                                jCheckBox3.setText(resourceMap.getString("jCheckBox3.text")); // NOI18N
                                                jCheckBox3.setName("jCheckBox3"); // NOI18N
                                                jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jCheckBox3ActionPerformed(evt);
                                                    }
                                                });

                                                jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
                                                jCheckBox1.setName("jCheckBox1"); // NOI18N
                                                jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jCheckBox1ActionPerformed(evt);
                                                    }
                                                });

                                                jCheckBox2.setText(resourceMap.getString("jCheckBox2.text")); // NOI18N
                                                jCheckBox2.setName("jCheckBox2"); // NOI18N
                                                jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jCheckBox2ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                                jPanel5.setLayout(jPanel5Layout);
                                                jPanel5Layout.setHorizontalGroup(
                                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 822, Short.MAX_VALUE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                                                .addComponent(jLabel11)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_opcion, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_idsubfamilia, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jCheckBox2, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                                                            .addComponent(jCheckBox1, javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jCheckBox3, javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                                                .addGap(10, 10, 10)
                                                                .addComponent(jtf_describereporte, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)))
                                                        .addContainerGap())
                                                );
                                                jPanel5Layout.setVerticalGroup(
                                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane5, 0, 0, Short.MAX_VALUE)
                                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel11)
                                                            .addComponent(jtf_opcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_idsubfamilia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel10))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_describereporte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jCheckBox3)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jCheckBox1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jCheckBox2)
                                                        .addContainerGap())
                                                );

                                                jPanel11.setBorder(javax.swing.BorderFactory.createEtchedBorder());
                                                jPanel11.setName("jPanel11"); // NOI18N

                                                jLabel12.setFont(resourceMap.getFont("jLabel12.font")); // NOI18N
                                                jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                                                jLabel12.setName("jLabel12"); // NOI18N

                                                buttonGroup2.add(jrbtn_columnaclave);
                                                jrbtn_columnaclave.setText(resourceMap.getString("jrbtn_columnaclave.text")); // NOI18N
                                                jrbtn_columnaclave.setActionCommand(resourceMap.getString("jrbtn_columnaclave.actionCommand")); // NOI18N
                                                jrbtn_columnaclave.setName("jrbtn_columnaclave"); // NOI18N
                                                jrbtn_columnaclave.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_columnaclaveActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jRadioButton1);
                                                jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
                                                jRadioButton1.setActionCommand(resourceMap.getString("jRadioButton1.actionCommand")); // NOI18N
                                                jRadioButton1.setName("jRadioButton1"); // NOI18N
                                                jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jRadioButton1ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_item);
                                                jrbtn_item.setText(resourceMap.getString("jrbtn_item.text")); // NOI18N
                                                jrbtn_item.setActionCommand(resourceMap.getString("jrbtn_item.actionCommand")); // NOI18N
                                                jrbtn_item.setName("jrbtn_item"); // NOI18N
                                                jrbtn_item.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_itemActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_linea);
                                                jrbtn_linea.setText(resourceMap.getString("jrbtn_linea.text")); // NOI18N
                                                jrbtn_linea.setActionCommand(resourceMap.getString("jrbtn_linea.actionCommand")); // NOI18N
                                                jrbtn_linea.setName("jrbtn_linea"); // NOI18N
                                                jrbtn_linea.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_lineaActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_temporada);
                                                jrbtn_temporada.setText(resourceMap.getString("jrbtn_temporada.text")); // NOI18N
                                                jrbtn_temporada.setActionCommand(resourceMap.getString("jrbtn_temporada.actionCommand")); // NOI18N
                                                jrbtn_temporada.setName("jrbtn_temporada"); // NOI18N
                                                jrbtn_temporada.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_temporadaActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_columnaclave1);
                                                jrbtn_columnaclave1.setText(resourceMap.getString("jrbtn_columnaclave1.text")); // NOI18N
                                                jrbtn_columnaclave1.setActionCommand(resourceMap.getString("jrbtn_columnaclave1.actionCommand")); // NOI18N
                                                jrbtn_columnaclave1.setName("jrbtn_columnaclave1"); // NOI18N
                                                jrbtn_columnaclave1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_columnaclave1ActionPerformed(evt);
                                                    }
                                                });

                                                jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
                                                jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                                                jLabel13.setName("jLabel13"); // NOI18N

                                                jtf_buscarenjtable.setText(resourceMap.getString("jtf_buscarenjtable.text")); // NOI18N
                                                jtf_buscarenjtable.setName("jtf_buscarenjtable"); // NOI18N
                                                jtf_buscarenjtable.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_buscarenjtableActionPerformed(evt);
                                                    }
                                                });

                                                jlb_resultado.setFont(resourceMap.getFont("jlb_resultado.font")); // NOI18N
                                                jlb_resultado.setText(resourceMap.getString("jlb_resultado.text")); // NOI18N
                                                jlb_resultado.setName("jlb_resultado"); // NOI18N

                                                jScrollPane1.setName("jScrollPane1"); // NOI18N

                                                jtb_articmasven.setModel(this.jtable_modelo);
                                                jtb_articmasven.setName("jtb_articmasven"); // NOI18N
                                                jtb_articmasven.setRowHeight(26);
                                                jtb_articmasven.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_articmasvenMouseClicked(evt);

                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickmv(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclick(evt);
                                                            //System.out.println(" double click" );

                                                        }
                                                    }
                                                });
                                                jScrollPane1.setViewportView(jtb_articmasven);

                                                jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
                                                jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
                                                jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

                                                jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
                                                jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                                jLabel6.setName("jLabel6"); // NOI18N

                                                jScrollPane13.setName("jScrollPane13"); // NOI18N

                                                jtb_familias.setModel(this.jtable_modelo_familias);
                                                jtb_familias.setName("jtb_familias"); // NOI18N
                                                jtb_familias.setRowHeight(22);
                                                jtb_familias.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_familiasMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamiliafil(evt);
                                                            //System.out.println(" double click" );

                                                        }
                                                    }
                                                });
                                                jScrollPane13.setViewportView(jtb_familias);

                                                jPanel13.setName("jPanel13"); // NOI18N

                                                jScrollPane11.setName("jScrollPane11"); // NOI18N

                                                jep_articuloimagenestadistica3.setContentType(resourceMap.getString("jep_articuloimagenestadistica3.contentType")); // NOI18N
                                                jep_articuloimagenestadistica3.setEditable(false);
                                                jep_articuloimagenestadistica3.setName("jep_articuloimagenestadistica3"); // NOI18N
                                                jScrollPane11.setViewportView(jep_articuloimagenestadistica3);

                                                jbtn_imagenfull.setFont(resourceMap.getFont("jbtn_imagenfull.font")); // NOI18N
                                                jbtn_imagenfull.setIcon(resourceMap.getIcon("jbtn_imagenfull.icon")); // NOI18N
                                                jbtn_imagenfull.setText(resourceMap.getString("jbtn_imagenfull.text")); // NOI18N
                                                jbtn_imagenfull.setToolTipText(resourceMap.getString("jbtn_imagenfull.toolTipText")); // NOI18N
                                                jbtn_imagenfull.setName("jbtn_imagenfull"); // NOI18N
                                                jbtn_imagenfull.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_imagenfullActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
                                                jPanel13.setLayout(jPanel13Layout);
                                                jPanel13Layout.setHorizontalGroup(
                                                    jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel13Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jbtn_imagenfull)
                                                        .addContainerGap(149, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                                                );
                                                jPanel13Layout.setVerticalGroup(
                                                    jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                                                        .addComponent(jbtn_imagenfull, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                );

                                                javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
                                                jPanel11.setLayout(jPanel11Layout);
                                                jPanel11Layout.setHorizontalGroup(
                                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                                .addComponent(jLabel12)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jrbtn_columnaclave)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jRadioButton1)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_temporada)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_item)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_linea)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jrbtn_columnaclave1)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jLabel13)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 137, Short.MAX_VALUE)
                                                                .addComponent(jlb_resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel6))
                                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                                                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 747, Short.MAX_VALUE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                                    .addComponent(jScrollPane13, 0, 0, Short.MAX_VALUE)
                                                                    .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                                                        .addContainerGap())
                                                );
                                                jPanel11Layout.setVerticalGroup(
                                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel12)
                                                            .addComponent(jrbtn_columnaclave)
                                                            .addComponent(jRadioButton1)
                                                            .addComponent(jrbtn_temporada)
                                                            .addComponent(jrbtn_item)
                                                            .addComponent(jrbtn_linea)
                                                            .addComponent(jrbtn_columnaclave1)
                                                            .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel13)
                                                            .addComponent(jLabel6)
                                                            .addComponent(jlbl_cantidadregistros)
                                                            .addComponent(jlb_resultado))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                                                                .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)))
                                                );

                                                javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                                jPanel1.setLayout(jPanel1Layout);
                                                jPanel1Layout.setHorizontalGroup(
                                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );
                                                jPanel1Layout.setVerticalGroup(
                                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

                                                jPanel12.setName("jPanel12"); // NOI18N

                                                jPanel14.setName("jPanel14"); // NOI18N

                                                jScrollPane12.setName("jScrollPane12"); // NOI18N

                                                jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
                                                jepn_fotos.setName("jepn_fotos"); // NOI18N
                                                jScrollPane12.setViewportView(jepn_fotos);

                                                jtf_fotosartxpag.setText(resourceMap.getString("jtf_fotosartxpag.text")); // NOI18N
                                                jtf_fotosartxpag.setToolTipText(resourceMap.getString("jtf_fotosartxpag.toolTipText")); // NOI18N
                                                jtf_fotosartxpag.setName("jtf_fotosartxpag"); // NOI18N
                                                jtf_fotosartxpag.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_fotosartxpagActionPerformed(evt);
                                                    }
                                                });

                                                jlbl_paginas.setText(resourceMap.getString("jlbl_paginas.text")); // NOI18N
                                                jlbl_paginas.setName("jlbl_paginas"); // NOI18N

                                                jbtn_anterior.setText(resourceMap.getString("jbtn_anterior.text")); // NOI18N
                                                jbtn_anterior.setName("jbtn_anterior"); // NOI18N
                                                jbtn_anterior.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_anteriorActionPerformed(evt);
                                                    }
                                                });

                                                jtf_paginaactual.setText(resourceMap.getString("jtf_paginaactual.text")); // NOI18N
                                                jtf_paginaactual.setName("jtf_paginaactual"); // NOI18N
                                                jtf_paginaactual.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_paginaactualActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_siguiente.setText(resourceMap.getString("jbtn_siguiente.text")); // NOI18N
                                                jbtn_siguiente.setName("jbtn_siguiente"); // NOI18N
                                                jbtn_siguiente.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_siguienteActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
                                                jPanel14.setLayout(jPanel14Layout);
                                                jPanel14Layout.setHorizontalGroup(
                                                    jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(40, 40, 40)
                                                        .addComponent(jlbl_paginas)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jbtn_anterior)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jbtn_siguiente)
                                                        .addContainerGap(685, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 1061, Short.MAX_VALUE)
                                                );
                                                jPanel14Layout.setVerticalGroup(
                                                    jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jbtn_siguiente)
                                                            .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_anterior)
                                                            .addComponent(jlbl_paginas)
                                                            .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE))
                                                );

                                                javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
                                                jPanel12.setLayout(jPanel12Layout);
                                                jPanel12Layout.setHorizontalGroup(
                                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );
                                                jPanel12Layout.setVerticalGroup(
                                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel12.TabConstraints.tabTitle"), jPanel12); // NOI18N

                                                jPanel3.setName("jPanel3"); // NOI18N

                                                jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
                                                jPanel2.setName("jPanel2"); // NOI18N

                                                jScrollPane2.setName("jScrollPane2"); // NOI18N

                                                jtb_repxfamilias.setModel(this.jtable_modelo_familia);
                                                jtb_repxfamilias.setName("jtb_repxfamilias"); // NOI18N
                                                jtb_repxfamilias.setRowHeight(22);
                                                jtb_repxfamilias.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamilia(evt);
                                                            //System.out.println(" double click" );

                                                        }
                                                    }
                                                });
                                                jScrollPane2.setViewportView(jtb_repxfamilias);

                                                jrbtn_generagrafica.setText(resourceMap.getString("jrbtn_generagrafica.text")); // NOI18N
                                                jrbtn_generagrafica.setName("jrbtn_generagrafica"); // NOI18N
                                                jrbtn_generagrafica.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_generagraficaActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                                jPanel2.setLayout(jPanel2Layout);
                                                jPanel2Layout.setHorizontalGroup(
                                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                                        .addComponent(jrbtn_generagrafica)
                                                        .addContainerGap())
                                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 647, Short.MAX_VALUE)
                                                );
                                                jPanel2Layout.setVerticalGroup(
                                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jrbtn_generagrafica))
                                                );

                                                jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel6.border.title"))); // NOI18N
                                                jPanel6.setName("jPanel6"); // NOI18N

                                                jScrollPane3.setName("jScrollPane3"); // NOI18N

                                                jtb_repxfamiliasdetalle.setModel(this.jtable_modelo_familiadetsub);
                                                jtb_repxfamiliasdetalle.setName("jtb_repxfamiliasdetalle"); // NOI18N
                                                jtb_repxfamiliasdetalle.setRowHeight(22);
                                                jtb_repxfamiliasdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasdetalleMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamiliadet(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane3.setViewportView(jtb_repxfamiliasdetalle);

                                                javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                                jPanel6.setLayout(jPanel6Layout);
                                                jPanel6Layout.setHorizontalGroup(
                                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                                                );
                                                jPanel6Layout.setVerticalGroup(
                                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
                                                );

                                                jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel7.border.title"))); // NOI18N
                                                jPanel7.setName("jPanel7"); // NOI18N

                                                jScrollPane4.setName("jScrollPane4"); // NOI18N

                                                jtb_repxfamiliasdetarti.setModel(this.jtable_modelo_detallearticulo);
                                                jtb_repxfamiliasdetarti.setName("jtb_repxfamiliasdetarti"); // NOI18N
                                                jtb_repxfamiliasdetarti.setRowHeight(22);
                                                jtb_repxfamiliasdetarti.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasdetartiMouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickartidet(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickartidetid(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane4.setViewportView(jtb_repxfamiliasdetarti);

                                                jScrollPane6.setName("jScrollPane6"); // NOI18N

                                                jep_articuloimagenestadistica.setContentType(resourceMap.getString("jep_articuloimagenestadistica.contentType")); // NOI18N
                                                jep_articuloimagenestadistica.setEditable(false);
                                                jep_articuloimagenestadistica.setName("jep_articuloimagenestadistica"); // NOI18N
                                                jScrollPane6.setViewportView(jep_articuloimagenestadistica);

                                                jtf_idsubfam.setEditable(false);
                                                jtf_idsubfam.setText(resourceMap.getString("jtf_idsubfam.text")); // NOI18N
                                                jtf_idsubfam.setName("jtf_idsubfam"); // NOI18N

                                                jCheckBox4.setText(resourceMap.getString("jCheckBox4.text")); // NOI18N
                                                jCheckBox4.setName("jCheckBox4"); // NOI18N
                                                jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jCheckBox4ActionPerformed(evt);
                                                    }
                                                });

                                                jtf_idsubfamdescribe.setEditable(false);
                                                jtf_idsubfamdescribe.setName("jtf_idsubfamdescribe"); // NOI18N

                                                javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                                jPanel7.setLayout(jPanel7Layout);
                                                jPanel7Layout.setHorizontalGroup(
                                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 536, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                                .addComponent(jtf_idsubfam, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_idsubfamdescribe, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jCheckBox4)
                                                                .addContainerGap())
                                                            .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 489, Short.MAX_VALUE)))
                                                );
                                                jPanel7Layout.setVerticalGroup(
                                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                            .addComponent(jScrollPane6)
                                                            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jCheckBox4)
                                                            .addComponent(jtf_idsubfamdescribe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_idsubfam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                );

                                                javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                                jPanel3.setLayout(jPanel3Layout);
                                                jPanel3Layout.setHorizontalGroup(
                                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addContainerGap())
                                                );
                                                jPanel3Layout.setVerticalGroup(
                                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(25, 25, 25))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

                                                jPanel8.setName("jPanel8"); // NOI18N

                                                jScrollPane7.setName("jScrollPane7"); // NOI18N

                                                jtb_repxfamiliasxtienda.setModel(this.jtable_modelo_detxtie);
                                                jtb_repxfamiliasxtienda.setName("jtb_repxfamiliasxtienda"); // NOI18N
                                                jtb_repxfamiliasxtienda.setRowHeight(22);
                                                jtb_repxfamiliasxtienda.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasxtiendaMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickdetxtienda(evt);
                                                            //System.out.println(" double click" );
                                                        }

                                                    }
                                                });
                                                jScrollPane7.setViewportView(jtb_repxfamiliasxtienda);

                                                jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
                                                jPanel9.setName("jPanel9"); // NOI18N

                                                jScrollPane8.setName("jScrollPane8"); // NOI18N

                                                jtb_repxfamiliasdetalle2.setModel(this.jtable_modelo_familiadetsub2);
                                                jtb_repxfamiliasdetalle2.setName("jtb_repxfamiliasdetalle2"); // NOI18N
                                                jtb_repxfamiliasdetalle2.setRowHeight(22);
                                                jtb_repxfamiliasdetalle2.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasdetalle2MouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickfamiliadetxt(evt);
                                                            //System.out.println(" double click" );
                                                        }
                                                    }
                                                });
                                                jScrollPane8.setViewportView(jtb_repxfamiliasdetalle2);

                                                jtf_tiendaactivada.setEditable(false);
                                                jtf_tiendaactivada.setText(resourceMap.getString("jtf_tiendaactivada.text")); // NOI18N
                                                jtf_tiendaactivada.setName("jtf_tiendaactivada"); // NOI18N

                                                jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                                jLabel5.setName("jLabel5"); // NOI18N

                                                javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                                                jPanel9.setLayout(jPanel9Layout);
                                                jPanel9Layout.setHorizontalGroup(
                                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                        .addComponent(jLabel5)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_tiendaactivada, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addContainerGap(191, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 368, Short.MAX_VALUE)
                                                );
                                                jPanel9Layout.setVerticalGroup(
                                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel5)
                                                            .addComponent(jtf_tiendaactivada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                );

                                                jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel10.border.title"))); // NOI18N
                                                jPanel10.setName("jPanel10"); // NOI18N

                                                jScrollPane9.setName("jScrollPane9"); // NOI18N

                                                jtb_repxfamiliasdetarti2.setModel(this.jtable_modelo_detallearticulo2);
                                                jtb_repxfamiliasdetarti2.setName("jtb_repxfamiliasdetarti2"); // NOI18N
                                                jtb_repxfamiliasdetarti2.setRowHeight(22);
                                                jtb_repxfamiliasdetarti2.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_repxfamiliasdetarti2MouseClicked(evt);
                                                        if(evt.getClickCount() >= 1)
                                                        {
                                                            dioclickartidetxt(evt);
                                                        }
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickartidetidxt(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane9.setViewportView(jtb_repxfamiliasdetarti2);

                                                jScrollPane10.setName("jScrollPane10"); // NOI18N

                                                jep_articuloimagenestadistica2.setContentType(resourceMap.getString("jep_articuloimagenestadistica2.contentType")); // NOI18N
                                                jep_articuloimagenestadistica2.setEditable(false);
                                                jep_articuloimagenestadistica2.setName("jep_articuloimagenestadistica2"); // NOI18N
                                                jScrollPane10.setViewportView(jep_articuloimagenestadistica2);

                                                jtf_idsubfam1.setEditable(false);
                                                jtf_idsubfam1.setName("jtf_idsubfam1"); // NOI18N

                                                jtf_idsubfamdescribe1.setEditable(false);
                                                jtf_idsubfamdescribe1.setName("jtf_idsubfamdescribe1"); // NOI18N

                                                jCheckBox5.setText(resourceMap.getString("jCheckBox5.text")); // NOI18N
                                                jCheckBox5.setName("jCheckBox5"); // NOI18N
                                                jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jCheckBox5ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                                                jPanel10.setLayout(jPanel10Layout);
                                                jPanel10Layout.setHorizontalGroup(
                                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                                .addComponent(jtf_idsubfam1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_idsubfamdescribe1, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jCheckBox5))
                                                        .addContainerGap(141, Short.MAX_VALUE))
                                                    .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                                                );
                                                jPanel10Layout.setVerticalGroup(
                                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                                .addGap(42, 42, 42)
                                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(jtf_idsubfam1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(jtf_idsubfamdescribe1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jCheckBox5))
                                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                                .addGap(5, 5, 5)
                                                                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addContainerGap())
                                                );

                                                javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                                jPanel8.setLayout(jPanel8Layout);
                                                jPanel8Layout.setHorizontalGroup(
                                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel8Layout.createSequentialGroup()
                                                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel8Layout.createSequentialGroup()
                                                                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1051, Short.MAX_VALUE))
                                                        .addContainerGap())
                                                );
                                                jPanel8Layout.setVerticalGroup(
                                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel8Layout.createSequentialGroup()
                                                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

                                                jPanel15.setName("jPanel15"); // NOI18N

                                                jScrollPane14.setName("jScrollPane14"); // NOI18N

                                                jt_repmasvenprovee.setModel(this.jtable_modelo_prov);
                                                jt_repmasvenprovee.setName("jt_repmasvenprovee"); // NOI18N
                                                jt_repmasvenprovee.setRowHeight(26);
                                                jt_repmasvenprovee.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jt_repmasvenproveeMouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclick_prov(evt);
                                                        }
                                                    }
                                                });
                                                jScrollPane14.setViewportView(jt_repmasvenprovee);

                                                jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
                                                jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                                jLabel7.setName("jLabel7"); // NOI18N

                                                jlbl_cantidadregistros1.setFont(resourceMap.getFont("jlbl_cantidadregistros1.font")); // NOI18N
                                                jlbl_cantidadregistros1.setText(resourceMap.getString("jlbl_cantidadregistros1.text")); // NOI18N
                                                jlbl_cantidadregistros1.setName("jlbl_cantidadregistros1"); // NOI18N

                                                jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
                                                jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
                                                jLabel9.setName("jLabel9"); // NOI18N

                                                javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
                                                jPanel15.setLayout(jPanel15Layout);
                                                jPanel15Layout.setHorizontalGroup(
                                                    jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel15Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jLabel7)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jlbl_cantidadregistros1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel9)
                                                        .addContainerGap(873, Short.MAX_VALUE))
                                                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel15Layout.createSequentialGroup()
                                                            .addGap(6, 6, 6)
                                                            .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 1049, Short.MAX_VALUE)
                                                            .addGap(6, 6, 6)))
                                                );
                                                jPanel15Layout.setVerticalGroup(
                                                    jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel15Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel9)
                                                            .addComponent(jlbl_cantidadregistros1)
                                                            .addComponent(jLabel7))
                                                        .addContainerGap(512, Short.MAX_VALUE))
                                                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel15Layout.createSequentialGroup()
                                                            .addGap(31, 31, 31)
                                                            .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addContainerGap(47, Short.MAX_VALUE)))
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel15.TabConstraints.tabTitle"), jPanel15); // NOI18N

                                                jPanel16.setName("jPanel16"); // NOI18N

                                                jPanel17.setName("jPanel17"); // NOI18N

                                                jPanel18.setBorder(javax.swing.BorderFactory.createEtchedBorder());
                                                jPanel18.setName("jPanel18"); // NOI18N

                                                jLabel15.setFont(resourceMap.getFont("jLabel15.font")); // NOI18N
                                                jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
                                                jLabel15.setName("jLabel15"); // NOI18N

                                                buttonGroup2.add(jrbtn_columnaclave2);
                                                jrbtn_columnaclave2.setText(resourceMap.getString("jrbtn_columnaclave2.text")); // NOI18N
                                                jrbtn_columnaclave2.setActionCommand(resourceMap.getString("jrbtn_columnaclave2.actionCommand")); // NOI18N
                                                jrbtn_columnaclave2.setName("jrbtn_columnaclave2"); // NOI18N
                                                jrbtn_columnaclave2.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_columnaclave2ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jRadioButton2);
                                                jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
                                                jRadioButton2.setActionCommand(resourceMap.getString("jRadioButton2.actionCommand")); // NOI18N
                                                jRadioButton2.setName("jRadioButton2"); // NOI18N
                                                jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jRadioButton2ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_item1);
                                                jrbtn_item1.setText(resourceMap.getString("jrbtn_item1.text")); // NOI18N
                                                jrbtn_item1.setActionCommand(resourceMap.getString("jrbtn_item1.actionCommand")); // NOI18N
                                                jrbtn_item1.setName("jrbtn_item1"); // NOI18N
                                                jrbtn_item1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_item1ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_linea1);
                                                jrbtn_linea1.setText(resourceMap.getString("jrbtn_linea1.text")); // NOI18N
                                                jrbtn_linea1.setActionCommand(resourceMap.getString("jrbtn_linea1.actionCommand")); // NOI18N
                                                jrbtn_linea1.setName("jrbtn_linea1"); // NOI18N
                                                jrbtn_linea1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_linea1ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_temporada1);
                                                jrbtn_temporada1.setText(resourceMap.getString("jrbtn_temporada1.text")); // NOI18N
                                                jrbtn_temporada1.setActionCommand(resourceMap.getString("jrbtn_temporada1.actionCommand")); // NOI18N
                                                jrbtn_temporada1.setName("jrbtn_temporada1"); // NOI18N
                                                jrbtn_temporada1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_temporada1ActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup2.add(jrbtn_columnaclave3);
                                                jrbtn_columnaclave3.setText(resourceMap.getString("jrbtn_columnaclave3.text")); // NOI18N
                                                jrbtn_columnaclave3.setActionCommand(resourceMap.getString("jrbtn_columnaclave3.actionCommand")); // NOI18N
                                                jrbtn_columnaclave3.setName("jrbtn_columnaclave3"); // NOI18N
                                                jrbtn_columnaclave3.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_columnaclave3ActionPerformed(evt);
                                                    }
                                                });

                                                jLabel16.setFont(resourceMap.getFont("jLabel16.font")); // NOI18N
                                                jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
                                                jLabel16.setName("jLabel16"); // NOI18N

                                                jtf_buscarenjtable1.setName("jtf_buscarenjtable1"); // NOI18N
                                                jtf_buscarenjtable1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jtf_buscarenjtable1ActionPerformed(evt);
                                                    }
                                                });

                                                jlb_resultado1.setFont(resourceMap.getFont("jlb_resultado1.font")); // NOI18N
                                                jlb_resultado1.setText(resourceMap.getString("jlb_resultado1.text")); // NOI18N
                                                jlb_resultado1.setName("jlb_resultado1"); // NOI18N

                                                jScrollPane15.setName("jScrollPane15"); // NOI18N

                                                jtb_articmasven1.setModel(this.jtable_modelo_comvsventa);
                                                jtb_articmasven1.setName("jtb_articmasven1"); // NOI18N
                                                jtb_articmasven1.setRowHeight(26);
                                                jtb_articmasven1.addMouseListener(new java.awt.event.MouseAdapter() {
                                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                        jtb_articmasven1MouseClicked(evt);
                                                        if(evt.getClickCount() >= 2)
                                                        {
                                                            dioclickcvsv(evt);
                                                            //System.out.println(" double click" );

                                                        }
                                                    }
                                                });
                                                jScrollPane15.setViewportView(jtb_articmasven1);

                                                jlbl_cantidadregistros2.setFont(resourceMap.getFont("jlbl_cantidadregistros2.font")); // NOI18N
                                                jlbl_cantidadregistros2.setText(resourceMap.getString("jlbl_cantidadregistros2.text")); // NOI18N
                                                jlbl_cantidadregistros2.setName("jlbl_cantidadregistros2"); // NOI18N

                                                jLabel17.setFont(resourceMap.getFont("jLabel17.font")); // NOI18N
                                                jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
                                                jLabel17.setName("jLabel17"); // NOI18N

                                                javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
                                                jPanel18.setLayout(jPanel18Layout);
                                                jPanel18Layout.setHorizontalGroup(
                                                    jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel18Layout.createSequentialGroup()
                                                        .addComponent(jLabel15)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jrbtn_columnaclave2)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jRadioButton2)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jrbtn_temporada1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jrbtn_item1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jrbtn_linea1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jrbtn_columnaclave3)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel16)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 156, Short.MAX_VALUE)
                                                        .addComponent(jlb_resultado1, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(41, 41, 41)
                                                        .addComponent(jlbl_cantidadregistros2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel17)
                                                        .addGap(64, 64, 64))
                                                    .addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE)
                                                );
                                                jPanel18Layout.setVerticalGroup(
                                                    jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel18Layout.createSequentialGroup()
                                                        .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel15)
                                                            .addComponent(jrbtn_columnaclave2)
                                                            .addComponent(jRadioButton2)
                                                            .addComponent(jrbtn_temporada1)
                                                            .addComponent(jrbtn_item1)
                                                            .addComponent(jrbtn_linea1)
                                                            .addComponent(jrbtn_columnaclave3)
                                                            .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel16)
                                                            .addComponent(jlb_resultado1)
                                                            .addComponent(jlbl_cantidadregistros2)
                                                            .addComponent(jLabel17))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 508, Short.MAX_VALUE))
                                                );

                                                javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
                                                jPanel17.setLayout(jPanel17Layout);
                                                jPanel17Layout.setHorizontalGroup(
                                                    jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGap(0, 1061, Short.MAX_VALUE)
                                                    .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );
                                                jPanel17Layout.setVerticalGroup(
                                                    jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGap(0, 539, Short.MAX_VALUE)
                                                    .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
                                                jPanel16.setLayout(jPanel16Layout);
                                                jPanel16Layout.setHorizontalGroup(
                                                    jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );
                                                jPanel16Layout.setVerticalGroup(
                                                    jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                );

                                                jTabbedPane1.addTab(resourceMap.getString("jPanel16.TabConstraints.tabTitle"), jPanel16); // NOI18N

                                                jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
                                                jPanel4.setName("jPanel4"); // NOI18N

                                                jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                                jLabel8.setName("jLabel8"); // NOI18N

                                                buttonGroup3.add(jrbtn_piezas);
                                                jrbtn_piezas.setText(resourceMap.getString("jrbtn_piezas.text")); // NOI18N
                                                jrbtn_piezas.setActionCommand(resourceMap.getString("jrbtn_piezas.actionCommand")); // NOI18N
                                                jrbtn_piezas.setName("jrbtn_piezas"); // NOI18N
                                                jrbtn_piezas.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_piezasActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup3.add(jrbtn_importe);
                                                jrbtn_importe.setText(resourceMap.getString("jrbtn_importe.text")); // NOI18N
                                                jrbtn_importe.setActionCommand(resourceMap.getString("jrbtn_importe.actionCommand")); // NOI18N
                                                jrbtn_importe.setName("jrbtn_importe"); // NOI18N
                                                jrbtn_importe.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_importeActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup3.add(jrbtn_masrentable);
                                                jrbtn_masrentable.setText(resourceMap.getString("jrbtn_masrentable.text")); // NOI18N
                                                jrbtn_masrentable.setActionCommand(resourceMap.getString("jrbtn_masrentable.actionCommand")); // NOI18N
                                                jrbtn_masrentable.setName("jrbtn_masrentable"); // NOI18N
                                                jrbtn_masrentable.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_masrentableActionPerformed(evt);
                                                    }
                                                });

                                                jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                                jLabel1.setName("jLabel1"); // NOI18N

                                                jdc_fechainicial.setToolTipText(resourceMap.getString("jdc_fechainicial.toolTipText")); // NOI18N
                                                jdc_fechainicial.setDateFormatString(resourceMap.getString("jdc_fechainicial.dateFormatString")); // NOI18N
                                                jdc_fechainicial.setName("jdc_fechainicial"); // NOI18N
                                                jdc_fechainicial.addInputMethodListener(new java.awt.event.InputMethodListener() {
                                                    public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
                                                    }
                                                    public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
                                                        jdc_fechainicialInputMethodTextChanged(evt);
                                                    }
                                                });
                                                jdc_fechainicial.addKeyListener(new java.awt.event.KeyAdapter() {
                                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                                        jdc_fechainicialKeyPressed(evt);
                                                    }
                                                });

                                                jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                                                jLabel2.setName("jLabel2"); // NOI18N

                                                jdc_fechafinal.setToolTipText(resourceMap.getString("jdc_fechafinal.toolTipText")); // NOI18N
                                                jdc_fechafinal.setDateFormatString(resourceMap.getString("jdc_fechafinal.dateFormatString")); // NOI18N
                                                jdc_fechafinal.setMaxSelectableDate(new java.util.Date(253370790102000L));
                                                jdc_fechafinal.setName("jdc_fechafinal"); // NOI18N

                                                jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                                jLabel3.setName("jLabel3"); // NOI18N

                                                buttonGroup1.add(jrbtn_estemes);
                                                jrbtn_estemes.setText(resourceMap.getString("jrbtn_estemes.text")); // NOI18N
                                                jrbtn_estemes.setToolTipText(resourceMap.getString("jrbtn_estemes.toolTipText")); // NOI18N
                                                jrbtn_estemes.setName("jrbtn_estemes"); // NOI18N
                                                jrbtn_estemes.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_estemesActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup1.add(jrbtn_mespasada);
                                                jrbtn_mespasada.setText(resourceMap.getString("jrbtn_mespasada.text")); // NOI18N
                                                jrbtn_mespasada.setToolTipText(resourceMap.getString("jrbtn_mespasada.toolTipText")); // NOI18N
                                                jrbtn_mespasada.setName("jrbtn_mespasada"); // NOI18N
                                                jrbtn_mespasada.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_mespasadaActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup1.add(jrbtn_mesactuaante);
                                                jrbtn_mesactuaante.setText(resourceMap.getString("jrbtn_mesactuaante.text")); // NOI18N
                                                jrbtn_mesactuaante.setToolTipText(resourceMap.getString("jrbtn_mesactuaante.toolTipText")); // NOI18N
                                                jrbtn_mesactuaante.setName("jrbtn_mesactuaante"); // NOI18N
                                                jrbtn_mesactuaante.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_mesactuaanteActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup1.add(jrbtn_incluirtodo);
                                                jrbtn_incluirtodo.setText(resourceMap.getString("jrbtn_incluirtodo.text")); // NOI18N
                                                jrbtn_incluirtodo.setToolTipText(resourceMap.getString("jrbtn_incluirtodo.toolTipText")); // NOI18N
                                                jrbtn_incluirtodo.setName("jrbtn_incluirtodo"); // NOI18N
                                                jrbtn_incluirtodo.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_incluirtodoActionPerformed(evt);
                                                    }
                                                });

                                                jbtn_generareporte.setIcon(resourceMap.getIcon("jbtn_generareporte.icon")); // NOI18N
                                                jbtn_generareporte.setText(resourceMap.getString("jbtn_generareporte.text")); // NOI18N
                                                jbtn_generareporte.setToolTipText(resourceMap.getString("jbtn_generareporte.toolTipText")); // NOI18N
                                                jbtn_generareporte.setName("jbtn_generareporte"); // NOI18N
                                                jbtn_generareporte.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_generareporteActionPerformed(evt);
                                                    }
                                                });

                                                jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                                jLabel4.setName("jLabel4"); // NOI18N

                                                jcbx_tiendas.setToolTipText(resourceMap.getString("jcbx_tiendas.toolTipText")); // NOI18N
                                                jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
                                                jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jcbx_tiendasActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup4.add(jrbtn_Costo);
                                                jrbtn_Costo.setText(resourceMap.getString("jrbtn_Costo.text")); // NOI18N
                                                jrbtn_Costo.setActionCommand(resourceMap.getString("jrbtn_Costo.actionCommand")); // NOI18N
                                                jrbtn_Costo.setName("jrbtn_Costo"); // NOI18N
                                                jrbtn_Costo.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_CostoActionPerformed(evt);
                                                    }
                                                });

                                                buttonGroup4.add(jrbtn_precio);
                                                jrbtn_precio.setText(resourceMap.getString("jrbtn_precio.text")); // NOI18N
                                                jrbtn_precio.setActionCommand(resourceMap.getString("jrbtn_precio.actionCommand")); // NOI18N
                                                jrbtn_precio.setName("jrbtn_precio"); // NOI18N
                                                jrbtn_precio.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jrbtn_precioActionPerformed(evt);
                                                    }
                                                });

                                                jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
                                                jLabel14.setName("jLabel14"); // NOI18N

                                                jbtn_generareporte1.setIcon(resourceMap.getIcon("jbtn_generareporte1.icon")); // NOI18N
                                                jbtn_generareporte1.setText(resourceMap.getString("jbtn_generareporte1.text")); // NOI18N
                                                jbtn_generareporte1.setToolTipText(resourceMap.getString("jbtn_generareporte1.toolTipText")); // NOI18N
                                                jbtn_generareporte1.setName("jbtn_generareporte1"); // NOI18N
                                                jbtn_generareporte1.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jbtn_generareporte1ActionPerformed(evt);
                                                    }
                                                });

                                                javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                                jPanel4.setLayout(jPanel4Layout);
                                                jPanel4Layout.setHorizontalGroup(
                                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_piezas)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_importe)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_masrentable)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jdc_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jrbtn_estemes)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jrbtn_mespasada)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jrbtn_mesactuaante)
                                                                .addGap(8, 8, 8)
                                                                .addComponent(jrbtn_incluirtodo, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                                .addComponent(jbtn_generareporte, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jLabel4))
                                                            .addComponent(jbtn_generareporte1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                                .addComponent(jLabel14)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jrbtn_Costo)
                                                                .addGap(10, 10, 10)
                                                                .addComponent(jrbtn_precio)))
                                                        .addContainerGap(21, Short.MAX_VALUE))
                                                );
                                                jPanel4Layout.setVerticalGroup(
                                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel8)
                                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                .addComponent(jbtn_generareporte)
                                                                .addComponent(jLabel4)
                                                                .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jdc_fechafinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel2)
                                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                .addComponent(jrbtn_importe)
                                                                .addComponent(jrbtn_piezas)
                                                                .addComponent(jrbtn_masrentable))
                                                            .addComponent(jdc_fechainicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel1))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jrbtn_incluirtodo, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jrbtn_mesactuaante, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jrbtn_estemes, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jrbtn_mespasada, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel3)
                                                            .addComponent(jLabel14)
                                                            .addComponent(jrbtn_Costo)
                                                            .addComponent(jrbtn_precio)
                                                            .addComponent(jbtn_generareporte1))
                                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                );

                                                jMenuBar1.setName("jMenuBar1"); // NOI18N

                                                jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                                jMenu1.setName("jMenu1"); // NOI18N

                                                jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
                                                jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                                jmni_salir.setName("jmni_salir"); // NOI18N
                                                jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_salirActionPerformed(evt);
                                                    }
                                                });
                                                jMenu1.add(jmni_salir);

                                                jMenuBar1.add(jMenu1);

                                                jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
                                                jMenu2.setName("jMenu2"); // NOI18N

                                                jmni_iratiendas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_iratiendas.setText(resourceMap.getString("jmni_iratiendas.text")); // NOI18N
                                                jmni_iratiendas.setName("jmni_iratiendas"); // NOI18N
                                                jmni_iratiendas.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_iratiendasActionPerformed(evt);
                                                    }
                                                });
                                                jMenu2.add(jmni_iratiendas);

                                                jmni_fechainicial.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_fechainicial.setText(resourceMap.getString("jmni_fechainicial.text")); // NOI18N
                                                jmni_fechainicial.setName("jmni_fechainicial"); // NOI18N
                                                jmni_fechainicial.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_fechainicialActionPerformed(evt);
                                                    }
                                                });
                                                jMenu2.add(jmni_fechainicial);

                                                jmni_iraopcionesfecha.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_iraopcionesfecha.setText(resourceMap.getString("jmni_iraopcionesfecha.text")); // NOI18N
                                                jmni_iraopcionesfecha.setName("jmni_iraopcionesfecha"); // NOI18N
                                                jmni_iraopcionesfecha.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_iraopcionesfechaActionPerformed(evt);
                                                    }
                                                });
                                                jMenu2.add(jmni_iraopcionesfecha);

                                                jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                                jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                                jmni_escape.setName("jmni_escape"); // NOI18N
                                                jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_escapeActionPerformed(evt);
                                                    }
                                                });
                                                jMenu2.add(jmni_escape);

                                                jmni_irabusquedaenreporte.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
                                                jmni_irabusquedaenreporte.setText(resourceMap.getString("jmni_irabusquedaenreporte.text")); // NOI18N
                                                jmni_irabusquedaenreporte.setName("jmni_irabusquedaenreporte"); // NOI18N
                                                jmni_irabusquedaenreporte.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_irabusquedaenreporteActionPerformed(evt);
                                                    }
                                                });
                                                jMenu2.add(jmni_irabusquedaenreporte);

                                                jMenuBar1.add(jMenu2);

                                                jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                                                jMenu3.setName("jMenu3"); // NOI18N

                                                jmni_ayuda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_ayuda.setIcon(resourceMap.getIcon("jmni_ayuda.icon")); // NOI18N
                                                jmni_ayuda.setText(resourceMap.getString("jmni_ayuda.text")); // NOI18N
                                                jmni_ayuda.setName("jmni_ayuda"); // NOI18N
                                                jmni_ayuda.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_ayudaActionPerformed(evt);
                                                    }
                                                });
                                                jMenu3.add(jmni_ayuda);

                                                jmni_creacomentario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
                                                jmni_creacomentario.setText(resourceMap.getString("jmni_creacomentario.text")); // NOI18N
                                                jmni_creacomentario.setName("jmni_creacomentario"); // NOI18N
                                                jmni_creacomentario.addActionListener(new java.awt.event.ActionListener() {
                                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                        jmni_creacomentarioActionPerformed(evt);
                                                    }
                                                });
                                                jMenu3.add(jmni_creacomentario);

                                                jMenuBar1.add(jMenu3);

                                                setJMenuBar(jMenuBar1);

                                                javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                                getContentPane().setLayout(layout);
                                                layout.setHorizontalGroup(
                                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addComponent(jTabbedPane1, 0, 0, Short.MAX_VALUE)
                                                );
                                                layout.setVerticalGroup(
                                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE))
                                                );

                                                pack();
                                            }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
      if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
        {
            this.dispose();
        }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_iraopcionesfechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_iraopcionesfechaActionPerformed
        // TODO add your handling code here:
        this.jrbtn_mespasada.requestFocus();
    }//GEN-LAST:event_jmni_iraopcionesfechaActionPerformed

    private void jmni_iratiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_iratiendasActionPerformed
        // TODO add your handling code here:
        this.jcbx_tiendas.requestFocus();
    }//GEN-LAST:event_jmni_iratiendasActionPerformed

    private void jmni_fechainicialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_fechainicialActionPerformed
        // TODO add your handling code here:
        this.jdc_fechainicial.requestFocus();
    }//GEN-LAST:event_jmni_fechainicialActionPerformed

    private void jmni_ayudaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_ayudaActionPerformed
        // TODO add your handling code here:
        this.ayuda();
    }//GEN-LAST:event_jmni_ayudaActionPerformed

    private void jmni_creacomentarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_creacomentarioActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
    }//GEN-LAST:event_jmni_creacomentarioActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
       this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_distribuciontotal();
}//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_costo();
    }//GEN-LAST:event_jCheckBox2ActionPerformed

    private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox3ActionPerformed
        // TODO add your handling code here:
        if (Integer.valueOf(this.jtf_opcion.getText())==1)
            {
                articulos_sie_rep_resxsubfam_detalle repressubdet = new articulos_sie_rep_resxsubfam_detalle(Integer.valueOf(this.jtf_idsubfamilia.getText()),this.jtf_describereporte.getText());
                repressubdet.pack();
                repressubdet.setVisible(true);
            }
        else
           {
                JOptionPane.showMessageDialog(null,"Reporte solo disponible para Subfamilias", "Sistema Integral(Reporte Articulos Mas Vendidos) : Ayuda",1);
           }
   
    }//GEN-LAST:event_jCheckBox3ActionPerformed

    private void jtf_buscarenjtableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtableActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable(columnavisualisa, 0, this.jtf_buscarenjtable.getText().toUpperCase().trim());
    }//GEN-LAST:event_jtf_buscarenjtableActionPerformed

    private void jrbtn_columnaclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclaveActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclaveActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jmni_irabusquedaenreporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_irabusquedaenreporteActionPerformed
        // TODO add your handling code here:
        this.jtf_buscarenjtable.requestFocus();
    }//GEN-LAST:event_jmni_irabusquedaenreporteActionPerformed

    private void jrbtn_itemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_itemActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_itemActionPerformed

    private void jrbtn_lineaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_lineaActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_lineaActionPerformed

    private void jrbtn_temporadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_temporadaActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_temporadaActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
                indice=this.jTabbedPane1.getSelectedIndex();
                String arreglo_idtie[]=null;
                if((indice==0)&&(indice==5))
                {
                    i0=1;
                    arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.contruir_reporte(1,this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),"0",arreglo_idtie[0]);
                    this.contruir_reporte_compraarticulos(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),0,arreglo_idtie[0],this.jtf_idsubfamilia.getText(),"");
                    this.crea_hoja_comprasvsventas();
                    this.jtf_paginaactual.setText("0");
                }
                if((indice==2)&&(i2==0))
                        {
                            arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                            i2=1;
                            this.contruir_reporte_familia(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtie[0]);
                       }
               if((indice==3)&&(i3==0))
                        {
                            i3=1;
                            this.carga_datos_familiaresumen(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()), ordenamiento, "");
                       }

            if((indice==4)&&(i4==0))
                        {
                            i4=1;
                            arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                            this.contruir_reporte_prov(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtie[0]);
                       }
           

                this.centrar_datos();
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jrbtn_masrentableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_masrentableActionPerformed
        // TODO add your handling code here:
        ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_masrentableActionPerformed

    private void jrbtn_importeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_importeActionPerformed
        // TODO add your handling code here:
        ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_importeActionPerformed

    private void jrbtn_piezasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_piezasActionPerformed
        // TODO add your handling code here:
        ordenamiento=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_piezasActionPerformed

    private void jrbtn_estemesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_estemesActionPerformed
        // TODO add your handling code here:
        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fechahoy.getYear()+1900,fechahoy.getMonth(), 1);
        this.jdc_fechainicial.setDate(fechaini.getTime());
        this.jdc_fechafinal.setDate(fechahoy);
}//GEN-LAST:event_jrbtn_estemesActionPerformed

    private void jrbtn_mespasadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_mespasadaActionPerformed
        // TODO add your handling code here:
        Calendar fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        //establesemos la fecha en base a la de hoy menos 1 mes en el dia 1
        fechamesini.set(fechahoy.getYear()+1900,fechahoy.getMonth()-1, 1);
        this.jdc_fechainicial.setDate(fechamesini.getTime());
        //vemos cual fue el ultimo dia del mes anterior restando los dias del mes actual
        fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        int diadelmesactua=fechamesini.get(Calendar.DAY_OF_MONTH);
        fechamesini.add(Calendar.DATE, -diadelmesactua); // se resta el numero de dias del mes
        this.jdc_fechafinal.setDate(fechamesini.getTime());
}//GEN-LAST:event_jrbtn_mespasadaActionPerformed

    private void jrbtn_mesactuaanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_mesactuaanteActionPerformed
        // TODO add your handling code here:
        Calendar fechamesini = Calendar.getInstance(); // obtiene la fecha actual
        this.jdc_fechafinal.setDate(fechamesini.getTime());
        //establesemos la fecha en base a la de hoy menos 1 mes en el dia 1
        fechamesini.set(fechahoy.getYear()+1900,fechahoy.getMonth()-1, 1);
        this.jdc_fechainicial.setDate(fechamesini.getTime());
}//GEN-LAST:event_jrbtn_mesactuaanteActionPerformed

    private void jrbtn_incluirtodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_incluirtodoActionPerformed
        // TODO add your handling code here:
        Calendar fechainisem = Calendar.getInstance(); // obtiene la fecha actual


        fechainisem.set(2010,4,1); // incrementa en 30 días la fecha actual.
        this.jdc_fechainicial.setDate(fechainisem.getTime());

        this.jdc_fechafinal.setDate(fechahoy);
}//GEN-LAST:event_jrbtn_incluirtodoActionPerformed

    private void jbtn_generareporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generareporteActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            
            String arreglo_idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
            i0=0;
            i1=0;
            i2=0;
             i3=0;
             i4=0;
            if((indice==0)||(indice==5))
                {
                    i0=1;
                    this.contruir_reporte(1,this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),this.jtf_idsubfamilia.getText(),arreglo_idtie[0]);
                    this.jtf_paginaactual.setText("0");
                    this.contruir_reporte_compraarticulos(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,arreglo_idtie[0],this.jtf_idsubfamilia.getText(),"");
                    this.crea_hoja_comprasvsventas();
                }
            if(indice==2)
                {
                    i2=1;
                    this.contruir_reporte_familia(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtie[0]);
                }
            if(indice==3)
                {
                    i3=1;
                    this.carga_datos_familiaresumen(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()), ordenamiento, "");
                }
            if(indice==4)
                {
                    i4=1;
                    this.contruir_reporte_prov(this.jdc_fechainicial.getDate(),this.jdc_fechafinal.getDate(),ordenamiento,arreglo_idtie[0]);
                }
           

            this.centrar_datos();
        }
    }//GEN-LAST:event_jbtn_generareporteActionPerformed

    private void jdc_fechainicialKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jdc_fechainicialKeyPressed
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechainicialKeyPressed

    private void jdc_fechainicialInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jdc_fechainicialInputMethodTextChanged
        // TODO add your handling code here:
}//GEN-LAST:event_jdc_fechainicialInputMethodTextChanged

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:
        int indeceta=this.jcbx_tiendas.getSelectedIndex();


        if (controlcombo > 0 ) {
            this.jbtn_generareporteActionPerformed(evt);
        }



        //this.jtfpruebados.setText(jtable_tiendas.getValueAt(indeceta, 0).toString());
}//GEN-LAST:event_jcbx_tiendasActionPerformed

    private void jCheckBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox4ActionPerformed
        // TODO add your handling code here:
                articulos_sie_rep_resxsubfam_detalle repressubdet = new articulos_sie_rep_resxsubfam_detalle(Integer.valueOf(this.jtf_idsubfam.getText()),this.jtf_idsubfamdescribe.getText());
                repressubdet.pack();
                repressubdet.setVisible(true);
    }//GEN-LAST:event_jCheckBox4ActionPerformed

    private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox5ActionPerformed

    private void jrbtn_columnaclave1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclave1ActionPerformed

    private void jtf_fotosartxpagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpagActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_fotosartxpagActionPerformed

    private void jbtn_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anteriorActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jbtn_anteriorActionPerformed

    private void jtf_paginaactualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactualActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
}//GEN-LAST:event_jtf_paginaactualActionPerformed

    private void jbtn_siguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguienteActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));

    }//GEN-LAST:event_jbtn_siguienteActionPerformed

    private void jrbtn_generagraficaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_generagraficaActionPerformed
        // TODO add your handling code here:
        System.out.println("se crea nuevo:");
        ventas_sie_cortes_graficacion demo1amf = new ventas_sie_cortes_graficacion("Sistema Integral: Ventas X Familia",6);
        demo1amf.pack();
        RefineryUtilities.centerFrameOnScreen(demo1amf);
        demo1amf.setVisible(true);
}//GEN-LAST:event_jrbtn_generagraficaActionPerformed

    private void jbtn_imagenfullActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfullActionPerformed
        // TODO add your handling code here:
        int fila = jtb_articmasven.getSelectedRow();

        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(jtb_articmasven.getValueAt(fila, 1).toString());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
}//GEN-LAST:event_jbtn_imagenfullActionPerformed

    private void jrbtn_CostoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_CostoActionPerformed
        // TODO add your handling code here:
               vercop=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_CostoActionPerformed

    private void jrbtn_precioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_precioActionPerformed
        // TODO add your handling code here:
               vercop=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_precioActionPerformed

    private void jrbtn_columnaclave2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclave2ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jrbtn_item1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_item1ActionPerformed

    private void jrbtn_linea1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_linea1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_linea1ActionPerformed

    private void jrbtn_temporada1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_temporada1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_temporada1ActionPerformed

    private void jrbtn_columnaclave3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave3ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclave3ActionPerformed

    private void jtf_buscarenjtable1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtable1ActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable2(columnavisualisa, 0, this.jtf_buscarenjtable1.getText().toUpperCase().trim());
    }//GEN-LAST:event_jtf_buscarenjtable1ActionPerformed

    private void jbtn_generareporte1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generareporte1ActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Ver Estadistica con Fecha inicio:"+this.fechaeuropea(this.jdc_fechainicial.getDate())+" A Fecha:"+this.fechaeuropea(this.jdc_fechafinal.getDate()))==0) {
            ventas_sie_promociones fvsp=new ventas_sie_promociones(1,this.fechaeuropea(this.jdc_fechainicial.getDate()),this.fechaeuropea(this.jdc_fechafinal.getDate()),"0","0",this.jtf_idsubfamilia.getText());
            fvsp.pack();
            fvsp.setVisible(true);
        }
}//GEN-LAST:event_jbtn_generareporte1ActionPerformed
    private void jtb_articmasven1MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_familiasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_repxfamiliasdetarti2MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

    private void jtb_repxfamiliasdetalle2MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_repxfamiliasxtiendaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_repxfamiliasdetartiMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_repxfamiliasdetalleMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    
  private void jt_repmasvenproveeMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

    private  void ayuda()
            {
                String punto1="1.- Este Reporte muestra Ventas Por Articulo en rango de Fechas determinado \n";
                String punto2="2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado, uselo si desea mayor rapides ( ejemplo Alt+a obtendra ayuda automaticamente)\n";
                String punto3="3.- Algunos Reportes pueden tardar Unos minutos dependiento del rango de Fechas seleccionadas. \n ";
                String punto4="4.- Pase el Puntero del Mause sobre el Elemento este le mostrara una pequeña descripcion de lo qu hace. \n ";
                JOptionPane.showMessageDialog(null,""+punto1+punto2+punto3+punto4+"", "Sistema Integral(Reporte Articulos Mas Vendidos) : Ayuda",1);
            }
 private void crearcomentario()
          {
                 String retorno="";
       
        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Art. Mas Vendidos');",variables_global.getconexiongral());
            try
            {
               while (rs.next())
                    {
                         retorno=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);
                
              }

      }
    }

 private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_articmasven.getSelectedRow();
         String  valor[] = jtb_articmasven.getValueAt(fila, 2).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor[0].toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>",""));
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
}
 private void dioclickfamilia(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_repxfamilias.getSelectedRow();
         String idfami[] = jtb_repxfamilias.getValueAt(fila, 0).toString().split(":"),arreglo_idtie[]=null;
         arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");
        this.contruir_reporte_familia_detalle(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,arreglo_idtie[0],idfami[0]);
}
  private void dioclickfamiliadet(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        //System.out.println("dio doble  click");
        int fila = jtb_repxfamiliasdetalle.getSelectedRow();
        String idsubfami[] = jtb_repxfamiliasdetalle.getValueAt(fila, 1).toString().split(":"),arreglo_idtie[]=null,idfam = jtb_repxfamiliasdetalle.getValueAt(fila, 0).toString();
        arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");
        this.jtf_idsubfam.setText(idsubfami[0]);
        this.jtf_idsubfamdescribe.setText(idsubfami[1]);
        this.contruir_reporte_familia_detallearti(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,arreglo_idtie[0],idfam,idsubfami[0]);

}
    private void dioclickartidet(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_repxfamiliasdetarti.getSelectedRow();
         String id = jtb_repxfamiliasdetarti.getValueAt(fila, 0).toString();
         this.jep_articuloimagenestadistica.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+id+".JPG\" width=\"340\" height=\"270\" border=\"0\" alt=\"Foto Articulo\"></img>");
}

private void dioclickartidetid(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_repxfamiliasdetarti.getSelectedRow();
         String idarti[] = jtb_repxfamiliasdetarti.getValueAt(fila, 1).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(idarti[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
}
    private void dioclickdetxtienda(java.awt.event.MouseEvent evt) {
       // TODO add your handling code here:
        int fila = jtb_repxfamiliasxtienda.getSelectedRow();
        int columna =jtb_repxfamiliasxtienda.getSelectedColumn();
        String columtitulo[]= jtable_modelo_detxtie.getColumnName(columna).replace("<html><b>","").replace("</b></html>","").split(":");
        this.jtf_tiendaactivada.setText(columtitulo[0]+":"+columtitulo[1]);
        String idfami[] = jtb_repxfamiliasxtienda.getValueAt(fila, 0).toString().split(":");
        if(JOptionPane.showConfirmDialog(null, "Desea Ver Detalle de Tienda:"+columtitulo[1])==0)
            {
                    this.contruir_reporte_familia_detalle2(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,columtitulo[0],idfami[0]);
            }
    }
  private void dioclickfamiliadetxt(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        //System.out.println("dio doble  click");
        int fila = jtb_repxfamiliasdetalle2.getSelectedRow();
        String idsubfami[] = jtb_repxfamiliasdetalle2.getValueAt(fila, 1).toString().split(":"),arreglo_idtie[]=null,idfam = jtb_repxfamiliasdetalle2.getValueAt(fila, 0).toString();
        arreglo_idtie=this.jtf_tiendaactivada.getText().toString().split(":");
        this.jtf_idsubfam1.setText(idsubfami[0]);
        this.jtf_idsubfamdescribe1.setText(idsubfami[1]);
        this.contruir_reporte_familia_detallearti2(this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),ordenamiento,arreglo_idtie[0],idfam,idsubfami[0]);

}

private void dioclickartidetxt(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_repxfamiliasdetarti2.getSelectedRow();
         String id = jtb_repxfamiliasdetarti2.getValueAt(fila, 0).toString();
         this.jep_articuloimagenestadistica2.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+id+".JPG\" width=\"200\" height=\"150\" border=\"0\" alt=\"Foto Articulo\"></img>");
}
private void dioclickartidetidxt(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_repxfamiliasdetarti2.getSelectedRow();
         String idarti[] = jtb_repxfamiliasdetarti2.getValueAt(fila, 1).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(idarti[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
}
 private void dioclickmv(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_articmasven.getSelectedRow();
         String id = jtb_articmasven.getValueAt(fila, 1).toString();
         this.jep_articuloimagenestadistica3.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+id+".JPG\" width=\"250\" height=\"200\" border=\"0\" alt=\"Foto Articulo\"></img>");
}
 private void dioclickfamiliafil(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_familias.getSelectedRow();
         String idfami = jtb_familias.getValueAt(fila, 0).toString(),arreglo_idtie[]=null;
         arreglo_idtie=this.jcbx_tiendas.getSelectedItem().toString().split(":");

        this.contruir_reporte(3,this.fechaamericana(this.jdc_fechainicial.getDate()),this.fechaamericana(this.jdc_fechafinal.getDate()),idfami,arreglo_idtie[0]);
}

 private void dioclickcvsv(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
        int fila = jtb_articmasven1.getSelectedRow();
        String  valor[] = jtable_modelo_comvsventa.getValueAt(fila, 1).toString().split(":");

        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
}

 private void carga_datos_fotospaginacion(int pagina)
    {
        textohtml="";
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag.getText().toString());
        float totalpaginas=this.jtable_modelo.getRowCount()/artxpag;

        this.jlbl_paginas.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
  System.out.println("filas x pagina"+artxpag+"tOTAL FILAS:"+this.jtable_modelo.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>Lugar:"+jtable_modelo.getValueAt(ni, 0).toString()+" "+jtable_modelo.getValueAt(ni, 6).toString()+" "+jtable_modelo.getValueAt(ni, 1).toString()+"<br>"+jtable_modelo.getValueAt(ni, 2).toString() + " Pzs "+jtable_modelo.getValueAt(ni, 4).toString().replace("<html>", "</html>")+ " $ "+jtable_modelo.getValueAt(ni, 5).toString().replace("<html>", "</html>")+ "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo.getValueAt(ni, 1).toString()+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=4)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }
private void jtb_articmasvenMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtb_repxfamiliasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

private void find_textoenjtable(int columna,int filainicio,String texto)
    {

       int totalfilasreporte=this.jtable_modelo.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
        for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo.getValueAt(i, columnaanterior).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>","");
                jtable_modelo.setValueAt(cadenaobtenida, i,columnaanterior);
            }
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtb_articmasven.changeSelection(i, 0, true, false);
                        jtable_modelo.setValueAt("<html><BODY bgcolor=#CC0066>"+cadenaobtenida+"</BODY></html>", i,columna);
                        encontro=-1;
                        coincidencias++;
                    }
            }
        columnaanterior=columna;
            this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);

    }
private void find_textoenjtable2(int columna,int filainicio,String texto)
    {

       int totalfilasreporte=this.jtable_modelo_comvsventa.getRowCount(),i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
        for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_comvsventa.getValueAt(i, columnaanterior).toString().replace("<html><BODY bgcolor=#CC0066>", "").replace("</BODY></html>","");
                jtable_modelo_comvsventa.setValueAt(cadenaobtenida, i,columnaanterior);
            }
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_comvsventa.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtb_articmasven1.changeSelection(i, 0, true, false);
                        jtable_modelo_comvsventa.setValueAt("<html><BODY bgcolor=#CC0066>"+cadenaobtenida+"</BODY></html>", i,columna);
                        encontro=-1;
                        coincidencias++;
                    }
            }
        columnaanterior=columna;
            this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);

    }
 /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new articulos_sie_rep_masvendidos().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_anterior;
    private javax.swing.JButton jbtn_generareporte;
    private javax.swing.JButton jbtn_generareporte1;
    private javax.swing.JButton jbtn_imagenfull;
    private javax.swing.JButton jbtn_siguiente;
    private javax.swing.JComboBox jcbx_tiendas;
    private com.toedter.calendar.JDateChooser jdc_fechafinal;
    private com.toedter.calendar.JDateChooser jdc_fechainicial;
    private javax.swing.JEditorPane jep_articuloimagenestadistica;
    private javax.swing.JEditorPane jep_articuloimagenestadistica2;
    private javax.swing.JEditorPane jep_articuloimagenestadistica3;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlb_resultado;
    private javax.swing.JLabel jlb_resultado1;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_cantidadregistros1;
    private javax.swing.JLabel jlbl_cantidadregistros2;
    private javax.swing.JLabel jlbl_paginas;
    private javax.swing.JMenuItem jmni_ayuda;
    private javax.swing.JMenuItem jmni_creacomentario;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_fechainicial;
    private javax.swing.JMenuItem jmni_irabusquedaenreporte;
    private javax.swing.JMenuItem jmni_iraopcionesfecha;
    private javax.swing.JMenuItem jmni_iratiendas;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_Costo;
    private javax.swing.JRadioButton jrbtn_columnaclave;
    private javax.swing.JRadioButton jrbtn_columnaclave1;
    private javax.swing.JRadioButton jrbtn_columnaclave2;
    private javax.swing.JRadioButton jrbtn_columnaclave3;
    private javax.swing.JRadioButton jrbtn_estemes;
    private javax.swing.JRadioButton jrbtn_generagrafica;
    private javax.swing.JRadioButton jrbtn_importe;
    private javax.swing.JRadioButton jrbtn_incluirtodo;
    private javax.swing.JRadioButton jrbtn_item;
    private javax.swing.JRadioButton jrbtn_item1;
    private javax.swing.JRadioButton jrbtn_linea;
    private javax.swing.JRadioButton jrbtn_linea1;
    private javax.swing.JRadioButton jrbtn_masrentable;
    private javax.swing.JRadioButton jrbtn_mesactuaante;
    private javax.swing.JRadioButton jrbtn_mespasada;
    private javax.swing.JRadioButton jrbtn_piezas;
    private javax.swing.JRadioButton jrbtn_precio;
    private javax.swing.JRadioButton jrbtn_temporada;
    private javax.swing.JRadioButton jrbtn_temporada1;
    private javax.swing.JTable jt_repmasvenprovee;
    private javax.swing.JTable jt_ventasmensuales;
    private javax.swing.JTable jtb_articmasven;
    private javax.swing.JTable jtb_articmasven1;
    private javax.swing.JTable jtb_familias;
    private javax.swing.JTable jtb_repxfamilias;
    private javax.swing.JTable jtb_repxfamiliasdetalle;
    private javax.swing.JTable jtb_repxfamiliasdetalle2;
    private javax.swing.JTable jtb_repxfamiliasdetarti;
    private javax.swing.JTable jtb_repxfamiliasdetarti2;
    private javax.swing.JTable jtb_repxfamiliasxtienda;
    private javax.swing.JTextField jtf_buscarenjtable;
    private javax.swing.JTextField jtf_buscarenjtable1;
    private javax.swing.JTextField jtf_describereporte;
    private javax.swing.JTextField jtf_fotosartxpag;
    private javax.swing.JTextField jtf_idsubfam;
    private javax.swing.JTextField jtf_idsubfam1;
    private javax.swing.JTextField jtf_idsubfamdescribe;
    private javax.swing.JTextField jtf_idsubfamdescribe1;
    private javax.swing.JTextField jtf_idsubfamilia;
    private javax.swing.JTextField jtf_opcion;
    private javax.swing.JTextField jtf_paginaactual;
    private javax.swing.JTextField jtf_tiendaactivada;
    // End of variables declaration//GEN-END:variables

}
